]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/extra-utils/overviews/overviews-command.ts
Introduce search command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / overviews / overviews-command.ts
CommitLineData
23a3a882
C
1import { HttpStatusCode } from '@shared/core-utils'
2import { VideosOverview } from '@shared/models'
3import { AbstractCommand, OverrideCommandOptions } from '../shared'
4
5export class OverviewsCommand extends AbstractCommand {
6
7 getVideos (options: OverrideCommandOptions & {
8 page: number
23a3a882
C
9 }) {
10 const { token, page } = options
11 const path = '/api/v1/overviews/videos'
12
13 const query = { page }
14
15 return this.getRequestBody<VideosOverview>({
16 ...options,
17
18 token: token || null,
19 path,
20 query,
21 defaultExpectedStatus: HttpStatusCode.OK_200
22 })
23 }
24}