mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Simplify method
This commit is contained in:
parent
3e9cd74f5e
commit
d18914066b
@ -317,15 +317,10 @@ export class NotificationsHelper {
|
||||
*/
|
||||
public static async Delete(n: Notif) {
|
||||
// Delete a specific notification
|
||||
if(n.hasId)
|
||||
await DatabaseHelper.DeleteRows(NOTIFICATIONS_TABLE, {
|
||||
id: n.id
|
||||
})
|
||||
|
||||
// Delete wider range of notifications
|
||||
else
|
||||
await DatabaseHelper.DeleteRows(NOTIFICATIONS_TABLE, this.NotifToDB(n, false))
|
||||
const cond = n.hasId ? {id: n.id} : this.NotifToDB(n, false);
|
||||
|
||||
// Delete notifications
|
||||
await DatabaseHelper.DeleteRows(NOTIFICATIONS_TABLE, cond);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user