summaryrefslogtreecommitdiffstats
path: root/models/checklists.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/checklists.js')
-rw-r--r--models/checklists.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/models/checklists.js b/models/checklists.js
index 59682720..2521412f 100644
--- a/models/checklists.js
+++ b/models/checklists.js
@@ -185,9 +185,11 @@ if (Meteor.isServer) {
});
Checklists.before.remove((userId, doc) => {
- const activity = Activities.findOne({ checklistId: doc._id });
- if (activity) {
- Activities.remove(activity._id);
+ const activities = Activities.find({ checklistId: doc._id });
+ if (activities) {
+ activities.forEach((activity) => {
+ Activities.remove(activity._id);
+ });
}
});
}