aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-08 11:26:41 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-01-09 11:15:15 +0100
commit2f1548fda32c3ba9e53913270394eedfacd55986 (patch)
treeafee28df36a9e00f921603d9091e5d08d5818159 /server/models/account
parentf7cc67b455a12ccae9b0ea16876d166720364357 (diff)
downloadPeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.gz
PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.zst
PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.zip
Add notifications in the client
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/user-notification.ts6
1 files changed, 6 insertions, 0 deletions
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<UserNotificationModel> {
290 return UserNotificationModel.update({ read: true }, query) 290 return UserNotificationModel.update({ read: true }, query)
291 } 291 }
292 292
293 static markAllAsRead (userId: number) {
294 const query = { where: { userId } }
295
296 return UserNotificationModel.update({ read: true }, query)
297 }
298
293 toFormattedJSON (): UserNotification { 299 toFormattedJSON (): UserNotification {
294 const video = this.Video ? Object.assign(this.formatVideo(this.Video), { 300 const video = this.Video ? Object.assign(this.formatVideo(this.Video), {
295 channel: { 301 channel: {