summaryrefslogtreecommitdiffstats
path: root/models/checklistItems.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-03-11 20:26:23 +0200
committerLauri Ojansivu <x@xet7.org>2019-03-11 20:26:23 +0200
commitaee05a549f64cb70a838a4285d0a736d2a3ac819 (patch)
treeb8951e4971942cd9df7e6b6f26d9da7af93bbd69 /models/checklistItems.js
parent0155c7d8ce5591cab7c9cd4ace2be6cbd741f9a1 (diff)
parent7da2a8a15e2e33a321b21aa926fdcf493e2e0423 (diff)
downloadwekan-aee05a549f64cb70a838a4285d0a736d2a3ac819.tar.gz
wekan-aee05a549f64cb70a838a4285d0a736d2a3ac819.tar.bz2
wekan-aee05a549f64cb70a838a4285d0a736d2a3ac819.zip
v2.44
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'models/checklistItems.js')
-rw-r--r--models/checklistItems.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/models/checklistItems.js b/models/checklistItems.js
index 30e57aec..c46fe9bd 100644
--- a/models/checklistItems.js
+++ b/models/checklistItems.js
@@ -99,17 +99,6 @@ function itemCreation(userId, doc) {
}
function itemRemover(userId, doc) {
- const card = Cards.findOne(doc.cardId);
- const boardId = card.boardId;
- Activities.insert({
- userId,
- activityType: 'removedChecklistItem',
- cardId: doc.cardId,
- boardId,
- checklistId: doc.checklistId,
- checklistItemId: doc._id,
- checklistItemName:doc.title,
- });
Activities.remove({
checklistItemId: doc._id,
});
@@ -206,8 +195,19 @@ if (Meteor.isServer) {
itemCreation(userId, doc);
});
- ChecklistItems.after.remove((userId, doc) => {
+ ChecklistItems.before.remove((userId, doc) => {
itemRemover(userId, doc);
+ const card = Cards.findOne(doc.cardId);
+ const boardId = card.boardId;
+ Activities.insert({
+ userId,
+ activityType: 'removedChecklistItem',
+ cardId: doc.cardId,
+ boardId,
+ checklistId: doc.checklistId,
+ checklistItemId: doc._id,
+ checklistItemName:doc.title,
+ });
});
}