diff --git a/src/helpers/NotificationsHelper.ts b/src/helpers/NotificationsHelper.ts index 5d96dd1..420ea97 100644 --- a/src/helpers/NotificationsHelper.ts +++ b/src/helpers/NotificationsHelper.ts @@ -79,9 +79,7 @@ export class NotificationsHelper { if(await this.SimilarExists(n)) return; - - throw new Error("Create the notification!") - //await this.Create(n) + await this.Create(n) } /** @@ -97,6 +95,18 @@ export class NotificationsHelper { }) > 0; } + /** + * Create the notification + * + * @param n The notification + */ + private static async Create(n: Notif) { + await DatabaseHelper.InsertRow( + NOTIFICATIONS_TABLE, + this.NotifToDB(n, true) + ) + } + /** * Count the number of unread notifications of a user *