]>
Commit | Line | Data |
---|---|---|
e8bd7ce7 | 1 | import { CustomPage } from '@shared/models' |
2539932e | 2 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
e8bd7ce7 | 3 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
2539932e | 4 | |
e8bd7ce7 | 5 | export class CustomPagesCommand extends AbstractCommand { |
2539932e | 6 | |
e8bd7ce7 C |
7 | getInstanceHomepage (options: OverrideCommandOptions = {}) { |
8 | const path = '/api/v1/custom-pages/homepage/instance' | |
2539932e | 9 | |
e8bd7ce7 C |
10 | return this.getRequestBody<CustomPage>({ |
11 | ...options, | |
12 | path, | |
13 | defaultExpectedStatus: HttpStatusCode.OK_200 | |
14 | }) | |
15 | } | |
2539932e | 16 | |
e8bd7ce7 C |
17 | updateInstanceHomepage (options: OverrideCommandOptions & { |
18 | content: string | |
19 | }) { | |
20 | const { content } = options | |
21 | const path = '/api/v1/custom-pages/homepage/instance' | |
2539932e | 22 | |
e8bd7ce7 C |
23 | return this.putBodyRequest({ |
24 | ...options, | |
25 | path, | |
26 | fields: { content }, | |
27 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | |
28 | }) | |
29 | } | |
2539932e | 30 | } |