From f59545d97a80bf06025bf6343a80d834c7eb237f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Jul 2021 10:22:37 +0200 Subject: Rename command files --- .../custom-pages/custom-pages-command.ts | 30 ++++++++++++++++++++++ shared/extra-utils/custom-pages/custom-pages.ts | 30 ---------------------- shared/extra-utils/custom-pages/index.ts | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 shared/extra-utils/custom-pages/custom-pages-command.ts delete mode 100644 shared/extra-utils/custom-pages/custom-pages.ts (limited to 'shared/extra-utils/custom-pages') diff --git a/shared/extra-utils/custom-pages/custom-pages-command.ts b/shared/extra-utils/custom-pages/custom-pages-command.ts new file mode 100644 index 000000000..a062c9774 --- /dev/null +++ b/shared/extra-utils/custom-pages/custom-pages-command.ts @@ -0,0 +1,30 @@ +import { CustomPage } from '@shared/models' +import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' +import { AbstractCommand, OverrideCommandOptions } from '../shared' + +export class CustomPagesCommand extends AbstractCommand { + + getInstanceHomepage (options: OverrideCommandOptions = {}) { + const path = '/api/v1/custom-pages/homepage/instance' + + return this.getRequestBody({ + ...options, + path, + 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 }, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) + } +} diff --git a/shared/extra-utils/custom-pages/custom-pages.ts b/shared/extra-utils/custom-pages/custom-pages.ts deleted file mode 100644 index 56dabdc0f..000000000 --- a/shared/extra-utils/custom-pages/custom-pages.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { CustomPage } from '@shared/models' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' -import { AbstractCommand, OverrideCommandOptions } from '../shared' - -export class CustomPagesCommand extends AbstractCommand { - - getInstanceHomepage (options: OverrideCommandOptions = {}) { - const path = '/api/v1/custom-pages/homepage/instance' - - return this.getRequestBody({ - ...options, - path, - 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 }, - defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 - }) - } -} diff --git a/shared/extra-utils/custom-pages/index.ts b/shared/extra-utils/custom-pages/index.ts index 5e70778f8..58aed04f2 100644 --- a/shared/extra-utils/custom-pages/index.ts +++ b/shared/extra-utils/custom-pages/index.ts @@ -1 +1 @@ -export * from './custom-pages' +export * from './custom-pages-command' -- cgit v1.2.3