Procházet zdrojové kódy

Update comment.ts

https://youtrack.weseek.co.jp/issue/GW-7776
- Add empty method to get user Model
I Komang Mudana před 3 roky
rodič
revize
358b0760d6
1 změnil soubory, kde provedl 11 přidání a 0 odebrání
  1. 11 0
      packages/app/src/server/service/comment.ts

+ 11 - 0
packages/app/src/server/service/comment.ts

@@ -47,6 +47,10 @@ class CommentService {
 
         const activity = await this.createActivity(savedComment, SUPPORTED_ACTION_TYPE.ACTION_COMMENT_CREATE);
         await this.createAndSendNotifications(activity, page);
+
+        // TODO:   Send inAppNotification to mentioned users
+        // const mentionedUsers = await this.getMentionedUsers(savedComment.comment);
+        // await this.sendNotificationToMentionedUsers(mentionedUsers, activity, page);
       }
       catch (err) {
         logger.error('Error occurred while handling the comment create event:\n', err);
@@ -106,6 +110,8 @@ class CommentService {
 
   private getMentionedUsers = async(comment: string) => {
     // TODO extract users from comment
+    // Implement User model to find users ID
+
     // return User ObjectID array
   }
 
@@ -115,6 +121,11 @@ class CommentService {
     // Call inAppNotificationService.emitSocketIo;
   }
 
+  private getUserModel = () => {
+    // TODO get users model
+    // return users Model
+  }
+
 }