浏览代码

Show attachment name in Outgoing Webhook when attachment is removed from card.

Thanks to xet7 !

Related #2285
Lauri Ojansivu 6 年之前
父节点
当前提交
23ccb3b991
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      models/attachments.js

+ 8 - 4
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,
+    });
+  });
 }