diff options
Diffstat (limited to 'shared/extra-utils/overviews/overviews-command.ts')
-rw-r--r-- | shared/extra-utils/overviews/overviews-command.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/shared/extra-utils/overviews/overviews-command.ts b/shared/extra-utils/overviews/overviews-command.ts new file mode 100644 index 000000000..0ac3cbd33 --- /dev/null +++ b/shared/extra-utils/overviews/overviews-command.ts | |||
@@ -0,0 +1,25 @@ | |||
1 | import { HttpStatusCode } from '@shared/core-utils' | ||
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 | token?: string | ||
10 | }) { | ||
11 | const { token, page } = options | ||
12 | const path = '/api/v1/overviews/videos' | ||
13 | |||
14 | const query = { page } | ||
15 | |||
16 | return this.getRequestBody<VideosOverview>({ | ||
17 | ...options, | ||
18 | |||
19 | token: token || null, | ||
20 | path, | ||
21 | query, | ||
22 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
23 | }) | ||
24 | } | ||
25 | } | ||