aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/server-commands/src/overviews/overviews-command.ts
blob: decd2fd8e6a8c21c58a1aa6b986327a22b511178 (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
import { HttpStatusCode, VideosOverview } from '@peertube/peertube-models'
import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js'

export class OverviewsCommand extends AbstractCommand {

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

    const query = { page }

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

      path,
      query,
      implicitToken: false,
      defaultExpectedStatus: HttpStatusCode.OK_200
    })
  }
}