mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
shared/ typescript types dir server-commands
This commit is contained in:
parent
6b5f72beda
commit
bf54587a3e
242 changed files with 228 additions and 172 deletions
33
shared/server-commands/custom-pages/custom-pages-command.ts
Normal file
33
shared/server-commands/custom-pages/custom-pages-command.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { CustomPage, HttpStatusCode } from '@shared/models'
|
||||
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
||||
|
||||
export class CustomPagesCommand extends AbstractCommand {
|
||||
|
||||
getInstanceHomepage (options: OverrideCommandOptions = {}) {
|
||||
const path = '/api/v1/custom-pages/homepage/instance'
|
||||
|
||||
return this.getRequestBody<CustomPage>({
|
||||
...options,
|
||||
|
||||
path,
|
||||
implicitToken: false,
|
||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
}
|
||||
|
||||
updateInstanceHomepage (options: OverrideCommandOptions & {
|
||||
content: string
|
||||
}) {
|
||||
const { content } = options
|
||||
const path = '/api/v1/custom-pages/homepage/instance'
|
||||
|
||||
return this.putBodyRequest({
|
||||
...options,
|
||||
|
||||
path,
|
||||
fields: { content },
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue