Explorar o código

excecute to emit comment event after removing comment document

kaori %!s(int64=4) %!d(string=hai) anos
pai
achega
f63cbcecdc
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;
   };