]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-comment.ts
Fix offset/limit on some SQL queries :facepalm:
[github/Chocobozzz/PeerTube.git] / server / models / video / video-comment.ts
index 353fb1a0eb947cbee47b8ef28d9b88242c10f5d4..86766a5d1edc841c49139e966fe0ac9ae8443bcb 100644 (file)
@@ -329,8 +329,8 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
   static listAndCountByVideoId (videoId: number, start: number, count: number, t?: Sequelize.Transaction, order: 'ASC' | 'DESC' = 'ASC') {
     const query = {
       order: [ [ 'createdAt', order ] ],
-      start,
-      count,
+      offset: start,
+      limit: count,
       where: {
         videoId
       },
@@ -343,8 +343,8 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
   static listForFeed (start: number, count: number, videoId?: number) {
     const query = {
       order: [ [ 'createdAt', 'DESC' ] ],
-      start,
-      count,
+      offset: start,
+      limit: count,
       where: {},
       include: [
         {