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