diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-06-27 04:06:21 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-06-27 04:06:21 +0300 |
commit | 5283ba9ebbedf11540ffef1d4d87891c5ce9efc7 (patch) | |
tree | 65355a19da1796d3ca34ceda95f96c731b22bae9 /models/cardComments.js | |
parent | 7c89336ea9125648ed9b5ba50de16e4e4a2d0fc4 (diff) | |
download | wekan-5283ba9ebbedf11540ffef1d4d87891c5ce9efc7.tar.gz wekan-5283ba9ebbedf11540ffef1d4d87891c5ce9efc7.tar.bz2 wekan-5283ba9ebbedf11540ffef1d4d87891c5ce9efc7.zip |
- Fix Outgoing Webhook messages for Checlists, Checklist Items, Card comments, Add/Remove CustomField to board.
Not yet fixed is Outgoing Webhook message about setting CustomField value.
Thanks to xet7 !
Related #1969
Diffstat (limited to 'models/cardComments.js')
-rw-r--r-- | models/cardComments.js | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/models/cardComments.js b/models/cardComments.js index 2bcb5453..a823066c 100644 --- a/models/cardComments.js +++ b/models/cardComments.js @@ -81,14 +81,15 @@ CardComments.helpers({ CardComments.hookOptions.after.update = { fetchPrevious: false }; function commentCreation(userId, doc){ + const card = Cards.findOne(doc.cardId); Activities.insert({ userId, activityType: 'addComment', boardId: doc.boardId, cardId: doc.cardId, commentId: doc._id, - listId: doc.listId, - swimlaneId: doc.swimlaneId, + listId: card.listId, + swimlaneId: card.swimlaneId, }); } @@ -103,6 +104,34 @@ if (Meteor.isServer) { commentCreation(userId, doc); }); + CardComments.after.update((userId, doc) => { + const activity = Activities.findOne({ commentId: doc._id }); + const card = Cards.findOne(doc.cardId); + Activities.insert({ + userId, + activityType: 'editComment', + boardId: doc.boardId, + cardId: doc.cardId, + commentId: doc._id, + listId: card.listId, + swimlaneId: card.swimlaneId, + }); + }); + + CardComments.before.remove((userId, doc) => { + const activity = Activities.findOne({ commentId: doc._id }); + const card = Cards.findOne(doc.cardId); + Activities.insert({ + userId, + activityType: 'deleteComment', + boardId: doc.boardId, + cardId: doc.cardId, + commentId: doc._id, + listId: card.listId, + swimlaneId: card.swimlaneId, + }); + }); + CardComments.after.remove((userId, doc) => { const activity = Activities.findOne({ commentId: doc._id }); if (activity) { |