aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/overviews/overviews-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/overviews/overviews-command.ts')
-rw-r--r--shared/extra-utils/overviews/overviews-command.ts25
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 @@
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
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}