From 2f1548fda32c3ba9e53913270394eedfacd55986 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jan 2019 11:26:41 +0100 Subject: Add notifications in the client --- server/models/account/user-notification.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/models') diff --git a/server/models/account/user-notification.ts b/server/models/account/user-notification.ts index 79afce600..9e4f982a3 100644 --- a/server/models/account/user-notification.ts +++ b/server/models/account/user-notification.ts @@ -290,6 +290,12 @@ export class UserNotificationModel extends Model { return UserNotificationModel.update({ read: true }, query) } + static markAllAsRead (userId: number) { + const query = { where: { userId } } + + return UserNotificationModel.update({ read: true }, query) + } + toFormattedJSON (): UserNotification { const video = this.Video ? Object.assign(this.formatVideo(this.Video), { channel: { -- cgit v1.2.3