Remove explicit passing of transaction to createWithContext

This commit is contained in:
Tom Moor
2024-11-02 19:27:17 -04:00
parent 774402560e
commit aa579412d0
3 changed files with 24 additions and 42 deletions
+6 -12
View File
@@ -710,19 +710,13 @@ router.post(
}
await collection.save({ transaction });
await Event.createFromContext(
ctx,
{
name: "collections.update",
collectionId: collection.id,
data: {
name,
},
await Event.createFromContext(ctx, {
name: "collections.update",
collectionId: collection.id,
data: {
name,
},
{
transaction,
}
);
});
if (privacyChanged || sharingChanged) {
await Event.createFromContext(ctx, {
+14 -22
View File
@@ -390,18 +390,14 @@ router.post(
});
if (created) {
await Event.createFromContext(
ctx,
{
name: "comments.add_reaction",
modelId: comment.id,
documentId: comment.documentId,
data: {
emoji,
},
await Event.createFromContext(ctx, {
name: "comments.add_reaction",
modelId: comment.id,
documentId: comment.documentId,
data: {
emoji,
},
{ transaction }
);
});
}
ctx.body = {
@@ -446,18 +442,14 @@ router.post(
await reaction.destroy({ transaction });
await Event.createFromContext(
ctx,
{
name: "comments.remove_reaction",
modelId: comment.id,
documentId: comment.documentId,
data: {
emoji,
},
await Event.createFromContext(ctx, {
name: "comments.remove_reaction",
modelId: comment.id,
documentId: comment.documentId,
data: {
emoji,
},
{ transaction }
);
});
ctx.body = {
success: true,
@@ -163,14 +163,10 @@ router.post(
await integration.destroy({ transaction });
await Event.createFromContext(
ctx,
{
name: "integrations.delete",
modelId: integration.id,
},
{ transaction }
);
await Event.createFromContext(ctx, {
name: "integrations.delete",
modelId: integration.id,
});
ctx.body = {
success: true,