mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Fix removed checklistItem activity => dangling activities created
This commit is contained in:
parent
97822f35fd
commit
2ec1664408
1 changed files with 12 additions and 12 deletions
|
@ -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,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue