Procházet zdrojové kódy

excecute to emit comment event after removing comment document

kaori před 4 roky
rodič
revize
f63cbcecdc
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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;
   };