chore: Extend use of Event.createFromContext (#7010)
This commit is contained in:
@@ -78,16 +78,14 @@ router.post(
|
||||
},
|
||||
{ transaction }
|
||||
);
|
||||
await Event.create(
|
||||
await Event.createFromContext(
|
||||
ctx,
|
||||
{
|
||||
name: "attachments.create",
|
||||
data: {
|
||||
name,
|
||||
},
|
||||
modelId,
|
||||
teamId: user.teamId,
|
||||
actorId: user.id,
|
||||
ip: ctx.request.ip,
|
||||
},
|
||||
{ transaction }
|
||||
);
|
||||
@@ -141,11 +139,8 @@ router.post(
|
||||
|
||||
authorize(user, "delete", attachment);
|
||||
await attachment.destroy();
|
||||
await Event.create({
|
||||
await Event.createFromContext(ctx, {
|
||||
name: "attachments.delete",
|
||||
teamId: user.teamId,
|
||||
actorId: user.id,
|
||||
ip: ctx.request.ip,
|
||||
});
|
||||
|
||||
ctx.body = {
|
||||
|
||||
Reference in New Issue
Block a user