summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authormaulal <maulal@none.fr>2017-02-25 02:16:00 +0100
committermaulal <maulal@none.fr>2017-02-25 02:16:00 +0100
commit06699007c416372b93cd4ac58e6c085375c792ee (patch)
tree1f6d346980fcdd3cc944cd302a139da45143cc63 /models/cards.js
parent29fdfb9c886f1a906a27398fd546ad6cdb929ff9 (diff)
downloadwekan-06699007c416372b93cd4ac58e6c085375c792ee.tar.gz
wekan-06699007c416372b93cd4ac58e6c085375c792ee.tar.bz2
wekan-06699007c416372b93cd4ac58e6c085375c792ee.zip
Bug: orphan documents were created when cards were deleted
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js
index 9c149e51..922fbecd 100644
--- a/models/cards.js
+++ b/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,
+ });
});
}