aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/user/user-notification.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-03 10:23:44 +0100
committerChocobozzz <me@florianbigard.com>2022-03-03 10:23:44 +0100
commit156c44c8f6522686635089ecff7a358b4145d545 (patch)
tree770d4b8b154ee0942fc7e37ffd697a3b7ec02c71 /server/models/user/user-notification.ts
parentbf521f51fc561b38d2e1432213a75427f671dda9 (diff)
downloadPeerTube-156c44c8f6522686635089ecff7a358b4145d545.tar.gz
PeerTube-156c44c8f6522686635089ecff7a358b4145d545.tar.zst
PeerTube-156c44c8f6522686635089ecff7a358b4145d545.zip
Refactor a little bit raw sql builders
Diffstat (limited to 'server/models/user/user-notification.ts')
-rw-r--r--server/models/user/user-notification.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/models/user/user-notification.ts b/server/models/user/user-notification.ts
index eca127e7e..6209cb4bf 100644
--- a/server/models/user/user-notification.ts
+++ b/server/models/user/user-notification.ts
@@ -249,8 +249,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti
249 offset: start, 249 offset: start,
250 limit: count, 250 limit: count,
251 sort, 251 sort,
252 where, 252 where
253 sequelize: this.sequelize
254 } 253 }
255 254
256 if (unread !== undefined) query.where['read'] = !unread 255 if (unread !== undefined) query.where['read'] = !unread
@@ -261,7 +260,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti
261 260
262 count === 0 261 count === 0
263 ? [] as UserNotificationModelForApi[] 262 ? [] as UserNotificationModelForApi[]
264 : new UserNotificationListQueryBuilder(query).listNotifications() 263 : new UserNotificationListQueryBuilder(this.sequelize, query).listNotifications()
265 ]).then(([ total, data ]) => ({ total, data })) 264 ]).then(([ total, data ]) => ({ total, data }))
266 } 265 }
267 266