Просмотр исходного кода

excecute to emit comment event after removing comment document

kaori 4 лет назад
Родитель
Сommit
f63cbcecdc
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/server/models/comment.js

+ 2 - 2
packages/app/src/server/models/comment.js

@@ -104,12 +104,12 @@ module.exports = function(crowi) {
     const Comment = crowi.model('Comment');
     const commentEvent = crowi.event('comment');
 
-    await commentEvent.emit('remove', comment);
-
     await Comment.remove({
       $or: (
         [{ replyTo: this._id }, { _id: this._id }]),
     });
+
+    await commentEvent.emit('remove', comment);
     return;
   };