- static listForApi (parameters: {
- actorId: number
- start: number
- count: number
- sort: string
- }) {
- const { actorId } = parameters
-
- const query = {
- offset: parameters.start,
- limit: parameters.count,
- order: getSort(parameters.sort)
- }
-
- return VideoChannelModel
- .scope({
- method: [ ScopeNames.FOR_API, { actorId } as AvailableForListOptions ]
- })
- .findAndCountAll(query)
- .then(({ rows, count }) => {
- return { total: count, data: rows }
- })
- }
-