Explorar el Código

excecute to emit comment event after removing comment document

kaori hace 4 años
padre
commit
f63cbcecdc
Se han modificado 1 ficheros con 2 adiciones y 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;
   };