mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Delete all activities related to a checklist when it is deleted
This commit is contained in:
parent
ee938c0423
commit
a579125a1f
1 changed files with 5 additions and 3 deletions
|
|
@ -185,9 +185,11 @@ if (Meteor.isServer) {
|
||||||
});
|
});
|
||||||
|
|
||||||
Checklists.before.remove((userId, doc) => {
|
Checklists.before.remove((userId, doc) => {
|
||||||
const activity = Activities.findOne({ checklistId: doc._id });
|
const activities = Activities.find({ checklistId: doc._id });
|
||||||
if (activity) {
|
if (activities) {
|
||||||
Activities.remove(activity._id);
|
activities.forEach((activity) => {
|
||||||
|
Activities.remove(activity._id);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue