]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/extra-utils/custom-pages/custom-pages-command.ts
Rename command files
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / custom-pages / custom-pages-command.ts
1 import { CustomPage } from '@shared/models'
2 import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes'
3 import { AbstractCommand, OverrideCommandOptions } from '../shared'
4
5 export class CustomPagesCommand extends AbstractCommand {
6
7 getInstanceHomepage (options: OverrideCommandOptions = {}) {
8 const path = '/api/v1/custom-pages/homepage/instance'
9
10 return this.getRequestBody<CustomPage>({
11 ...options,
12 path,
13 defaultExpectedStatus: HttpStatusCode.OK_200
14 })
15 }
16
17 updateInstanceHomepage (options: OverrideCommandOptions & {
18 content: string
19 }) {
20 const { content } = options
21 const path = '/api/v1/custom-pages/homepage/instance'
22
23 return this.putBodyRequest({
24 ...options,
25 path,
26 fields: { content },
27 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
28 })
29 }
30 }