chore: Extend use of Event.createFromContext (#7010)
This commit is contained in:
@@ -335,17 +335,15 @@ async function updateRole(ctx: APIContext<T.UsersChangeRoleReq>) {
|
||||
|
||||
await user.update({ role }, { transaction });
|
||||
|
||||
await Event.create(
|
||||
await Event.createFromContext(
|
||||
ctx,
|
||||
{
|
||||
name,
|
||||
userId,
|
||||
actorId: actor.id,
|
||||
teamId: actor.teamId,
|
||||
data: {
|
||||
name: user.name,
|
||||
role,
|
||||
},
|
||||
ip: ctx.request.ip,
|
||||
},
|
||||
{
|
||||
transaction,
|
||||
|
||||
Reference in New Issue
Block a user