|
|
@@ -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
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|