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

And frienship notifications support

This commit is contained in:
2020-03-24 18:16:51 +01:00
parent 27a0c7d1c8
commit 4bf99cb550
4 changed files with 41 additions and 1 deletions

View File

@ -2,6 +2,8 @@ import { Friend } from "../entities/Friend";
import { RequestHandler } from "../entities/RequestHandler";
import { FriendsHelper } from "../helpers/FriendsHelper";
import { UserHelper } from "../helpers/UserHelper";
import { NotificationsUtils } from "../utils/NotificationsUtils";
import { NotifEventType } from "../entities/Notification";
/**
* Friends controller
@ -110,7 +112,9 @@ export class FriendsController {
// Send the request
await FriendsHelper.SendRequest(h.getUserId(), friendID);
// TODO : create the notification
// Create the notification
await NotificationsUtils.CreateFriendsNotifications(
h.getUserId(), friendID, NotifEventType.SENT_FRIEND_REQUEST)
h.success("Send (create) the friendship request");
}