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:
parent
75b47cedcb
commit
f569e9163d
@ -19,6 +19,8 @@ import { statSync } from "fs";
|
|||||||
import { lookup } from "mime-types";
|
import { lookup } from "mime-types";
|
||||||
import { NewSurvey } from "../entities/NewSurvey";
|
import { NewSurvey } from "../entities/NewSurvey";
|
||||||
import { FriendsHelper } from "../helpers/FriendsHelper";
|
import { FriendsHelper } from "../helpers/FriendsHelper";
|
||||||
|
import { NotificationsUtils } from "../utils/NotificationsUtils";
|
||||||
|
import { NotifEventType } from "../entities/Notification";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Posts controller
|
* 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({
|
h.send({
|
||||||
success: "The post has been created!",
|
success: "The post has been created!",
|
||||||
|
Loading…
Reference in New Issue
Block a user