소스 검색

Send result before webhook

Andrés Manelli 8 년 전
부모
커밋
de1ca1d12a
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      models/cardComments.js
  2. 1 1
      server/notifications/outgoing.js

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

+ 1 - 1
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];
     });