Explorar o código

Add commentEvent.emit when comment updated

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