diff options
-rw-r--r-- | models/attachments.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/models/attachments.js b/models/attachments.js index fb32f497..71b30eee 100644 --- a/models/attachments.js +++ b/models/attachments.js @@ -88,18 +88,22 @@ if (Meteor.isServer) { } }); - Attachments.files.after.remove((userId, doc) => { - Activities.remove({ - attachmentId: doc._id, - }); + Attachments.files.before.remove((userId, doc) => { Activities.insert({ userId, type: 'card', activityType: 'deleteAttachment', + attachmentId: doc._id, boardId: doc.boardId, cardId: doc.cardId, listId: doc.listId, swimlaneId: doc.swimlaneId, }); }); + + Attachments.files.after.remove((userId, doc) => { + Activities.remove({ + attachmentId: doc._id, + }); + }); } |