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

Can delete notifications related to a friendship request

This commit is contained in:
2020-03-24 18:29:56 +01:00
parent 4bf99cb550
commit 9ced519618
3 changed files with 47 additions and 9 deletions

View File

@ -197,6 +197,22 @@ export class NotificationsHelper {
)
}
/**
* Delete notifications
*
* @param n Notification
*/
public static async Delete(n: Notif) {
// Delete a specific notification
if(n.hasId)
throw new Error("Please implement notification deletion with known ID!");
// Delete wider range of notifications
else
await DatabaseHelper.DeleteRows(NOTIFICATIONS_TABLE, this.NotifToDB(n, false))
}
/**
* Count the number of unread notifications of a user
*