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:
@ -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
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user