aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/overviews/overviews-command.ts
blob: 0ac3cbd33e7a705d6c9e85864350af82fd9f8839 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { HttpStatusCode } from '@shared/core-utils'
import { VideosOverview } from '@shared/models'
import { AbstractCommand, OverrideCommandOptions } from '../shared'

export class OverviewsCommand extends AbstractCommand {

  getVideos (options: OverrideCommandOptions & {
    page: number
    token?: string
  }) {
    const { token, page } = options
    const path = '/api/v1/overviews/videos'

    const query = { page }

    return this.getRequestBody<VideosOverview>({
      ...options,

      token: token || null,
      path,
      query,
      defaultExpectedStatus: HttpStatusCode.OK_200
    })
  }
}