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