mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 05:57:13 -04: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) => {
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue