1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-21 17:15:17 +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

@ -27,4 +27,25 @@ export class NotificationsUtils {
}));
}
/**
* Create & push friendship request notification
*
* @param fromUser Source user ID
* @param toUser Destination user ID
* @param action The kind of action
*/
public static async CreateFriendsNotifications(fromUser: number, toUser: number, action: NotifEventType) {
// TODO : Delete all the previous notifications
// PUsh the notification
await NotificationsHelper.Push(new Notif({
fromUserID: fromUser,
destUserID: toUser,
onElemID: fromUser, // Same as fromUser
onElemType: NotifElemType.FRIENDSHIP_REQUEST,
type: action
}));
}
}