]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/user/user-notification.ts
Fix video job error when video has been deleted
[github/Chocobozzz/PeerTube.git] / server / models / user / user-notification.ts
index eca127e7e1075fc44414db66ade1928b21d12094..6209cb4bfa81ae8f8c4f35a1d40551dbb8088eac 100644 (file)
@@ -249,8 +249,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti
       offset: start,
       limit: count,
       sort,
-      where,
-      sequelize: this.sequelize
+      where
     }
 
     if (unread !== undefined) query.where['read'] = !unread
@@ -261,7 +260,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti
 
       count === 0
         ? [] as UserNotificationModelForApi[]
-        : new UserNotificationListQueryBuilder(query).listNotifications()
+        : new UserNotificationListQueryBuilder(this.sequelize, query).listNotifications()
     ]).then(([ total, data ]) => ({ total, data }))
   }