From 196f959f1d9d5bbea7c77082219c3723e2755fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Fri, 29 Sep 2017 17:11:13 -0300 Subject: Add some parameters to webhook --- models/activities.js | 1 + server/notifications/outgoing.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/models/activities.js b/models/activities.js index 4ddcfa72..be290dce 100644 --- a/models/activities.js +++ b/models/activities.js @@ -110,6 +110,7 @@ if (Meteor.isServer) { if (activity.commentId) { const comment = activity.comment(); params.comment = comment.text; + params.commentId = comment._id; } if (activity.attachmentId) { const attachment = activity.attachment(); diff --git a/server/notifications/outgoing.js b/server/notifications/outgoing.js index 07a0a903..e6959c0e 100644 --- a/server/notifications/outgoing.js +++ b/server/notifications/outgoing.js @@ -29,7 +29,10 @@ Meteor.methods({ text: `${text}`, }; - ['cardId', 'listId', 'oldListId', 'boardId'].forEach((key) => { + [ 'cardId', 'listId', 'oldListId', + 'boardId', 'comment', 'user', + 'card', 'commentId' + ].forEach((key) => { if (params[key]) value[key] = params[key]; }); value.description = description; -- cgit v1.2.3-1-g7c22 From de1ca1d12ac8f347b82ce732f45c7e07ccf09d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Fri, 29 Sep 2017 18:40:44 -0300 Subject: Send result before webhook --- models/cardComments.js | 6 +++--- server/notifications/outgoing.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/cardComments.js b/models/cardComments.js index 352030f1..cc1c55bc 100644 --- a/models/cardComments.js +++ b/models/cardComments.js @@ -125,15 +125,15 @@ if (Meteor.isServer) { boardId: paramBoardId, }); - const cardComment = CardComments.findOne({_id: id, cardId:paramCardId, boardId: paramBoardId }); - commentCreation(req.body.authorId, cardComment); - JsonRoutes.sendResult(res, { code: 200, data: { _id: id, }, }); + + const cardComment = CardComments.findOne({_id: id, cardId:paramCardId, boardId: paramBoardId }); + commentCreation(req.body.authorId, cardComment); }); JsonRoutes.add('DELETE', '/api/boards/:boardId/cards/:cardId/comments/:commentId', function (req, res, next) { diff --git a/server/notifications/outgoing.js b/server/notifications/outgoing.js index e6959c0e..ed3d8df7 100644 --- a/server/notifications/outgoing.js +++ b/server/notifications/outgoing.js @@ -31,7 +31,7 @@ Meteor.methods({ [ 'cardId', 'listId', 'oldListId', 'boardId', 'comment', 'user', - 'card', 'commentId' + 'card', 'commentId', ].forEach((key) => { if (params[key]) value[key] = params[key]; }); -- cgit v1.2.3-1-g7c22