瀏覽代碼

Merge branch 'maulal-devel' into devel
Fix Bug: orphan documents were created when cards were deleted

Lauri Ojansivu 8 年之前
父節點
當前提交
7f978ea677
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      models/cards.js

+ 10 - 0
models/cards.js

@@ -354,9 +354,19 @@ if (Meteor.isServer) {
   });
 
   // Remove all activities associated with a card if we remove the card
+  // Remove also card_comments / checklists / attachments
   Cards.after.remove((userId, doc) => {
     Activities.remove({
       cardId: doc._id,
     });
+    Checklists.remove({
+      cardId: doc._id,
+    });
+    CardComments.remove({
+      cardId: doc._id,
+    });
+    Attachments.remove({
+      cardId: doc._id,
+    });
   });
 }