Explorar el Código

Add commentEvent.emit when comment updated

kaori hace 4 años
padre
commit
c242d80d0e
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      packages/app/src/server/models/comment.js

+ 4 - 1
packages/app/src/server/models/comment.js

@@ -65,8 +65,11 @@ module.exports = function(crowi) {
     }));
   };
 
-  commentSchema.statics.updateCommentsByPageId = function(comment, isMarkdown, commentId) {
+  commentSchema.statics.updateCommentsByPageId = async(comment, isMarkdown, commentId) => {
     const Comment = this;
+    const commentEvent = crowi.event('comment');
+
+    await commentEvent.emit('update', comment.creator);
 
     return Comment.findOneAndUpdate(
       { _id: commentId },