diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-13 17:43:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-13 18:07:35 +0200 |
commit | 9a4a9b6c4e193739d542f73ee85cd305067f2aea (patch) | |
tree | df9b719142dc098764c7a7878a086880b8f9e6bf /server/models/video/video-comment.ts | |
parent | 4555697f216e894e5651d8f6d3d971e7d0c17d17 (diff) | |
download | PeerTube-9a4a9b6c4e193739d542f73ee85cd305067f2aea.tar.gz PeerTube-9a4a9b6c4e193739d542f73ee85cd305067f2aea.tar.zst PeerTube-9a4a9b6c4e193739d542f73ee85cd305067f2aea.zip |
Fix offset/limit on some SQL queries :facepalm:
Diffstat (limited to 'server/models/video/video-comment.ts')
-rw-r--r-- | server/models/video/video-comment.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index 353fb1a0e..86766a5d1 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -329,8 +329,8 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
329 | static listAndCountByVideoId (videoId: number, start: number, count: number, t?: Sequelize.Transaction, order: 'ASC' | 'DESC' = 'ASC') { | 329 | static listAndCountByVideoId (videoId: number, start: number, count: number, t?: Sequelize.Transaction, order: 'ASC' | 'DESC' = 'ASC') { |
330 | const query = { | 330 | const query = { |
331 | order: [ [ 'createdAt', order ] ], | 331 | order: [ [ 'createdAt', order ] ], |
332 | start, | 332 | offset: start, |
333 | count, | 333 | limit: count, |
334 | where: { | 334 | where: { |
335 | videoId | 335 | videoId |
336 | }, | 336 | }, |
@@ -343,8 +343,8 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
343 | static listForFeed (start: number, count: number, videoId?: number) { | 343 | static listForFeed (start: number, count: number, videoId?: number) { |
344 | const query = { | 344 | const query = { |
345 | order: [ [ 'createdAt', 'DESC' ] ], | 345 | order: [ [ 'createdAt', 'DESC' ] ], |
346 | start, | 346 | offset: start, |
347 | count, | 347 | limit: count, |
348 | where: {}, | 348 | where: {}, |
349 | include: [ | 349 | include: [ |
350 | { | 350 | { |