From 91b6631984fa7097bd60aa013d1cf041d7b95f58 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 May 2019 15:09:38 +0200 Subject: Add pagination to account video channels endpoint --- server/models/video/video-channel.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index fb70e6625..d73be18d6 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -334,14 +334,21 @@ export class VideoChannelModel extends Model { }) } - static listByAccount (accountId: number) { + static listByAccount (options: { + accountId: number, + start: number, + count: number, + sort: string + }) { const query = { - order: getSort('createdAt'), + offset: options.start, + limit: options.count, + order: getSort(options.sort), include: [ { model: AccountModel, where: { - id: accountId + id: options.accountId }, required: true } -- cgit v1.2.3