1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Send a notification when a post is created

This commit is contained in:
Pierre HUBERT 2020-03-28 14:04:27 +01:00
parent 75b47cedcb
commit f569e9163d

View File

@ -19,6 +19,8 @@ import { statSync } from "fs";
import { lookup } from "mime-types";
import { NewSurvey } from "../entities/NewSurvey";
import { FriendsHelper } from "../helpers/FriendsHelper";
import { NotificationsUtils } from "../utils/NotificationsUtils";
import { NotifEventType } from "../entities/Notification";
/**
* Posts controller
@ -291,7 +293,9 @@ export class PostsController {
}
// TODO : create a notification
// Create a notification
await NotificationsUtils.CreatePostNotification(
h.getUserId(), postID, NotifEventType.ELEM_CREATED);
h.send({
success: "The post has been created!",