Browse Source

Merge branch 'devel' of https://github.com/andresmanelli/wekan into andresmanelli-devel

Lauri Ojansivu 7 years ago
parent
commit
d6ef4a8266
3 changed files with 8 additions and 4 deletions
  1. 1 0
      models/activities.js
  2. 3 3
      models/cardComments.js
  3. 4 1
      server/notifications/outgoing.js

+ 1 - 0
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();

+ 3 - 3
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) {

+ 4 - 1
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;