1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 16:45:16 +00:00

Create notification when posting a new comment

This commit is contained in:
2020-03-23 19:08:04 +01:00
parent bd83a77fb2
commit edc68a0275
4 changed files with 51 additions and 9 deletions

View File

@ -4,6 +4,8 @@ import { LikesHelper, LikesType } from "../helpers/LikesHelper";
import { check_string_before_insert, removeHTMLNodes } from "../utils/StringUtils";
import { time } from "../utils/DateUtils";
import { CommentsHelper } from "../helpers/CommentsHelper";
import { NotificationsUtils } from "../utils/NotificationsUtils";
import { NotifEventType } from "../entities/Notification";
/**
* Comments controller
@ -43,7 +45,8 @@ export class CommentsController {
const commentID = await CommentsHelper.Create(newComment);
// TODO : Create notifications
// Create notifications
await NotificationsUtils.CreatePostNotification(h.getUserId(), postID, NotifEventType.COMMENT_CREATED);
// TODO : Delete any notifications targetting this user about the post