refactor(server, web): standardize theme api response (#4664)

* web: standardize theme api response

* revert makefile change that i didn't mean to commit
This commit is contained in:
Wingy
2023-10-26 19:32:33 -07:00
committed by GitHub
parent 7ff68223ab
commit a08a687951
10 changed files with 22 additions and 28 deletions

View File

@@ -7836,12 +7836,12 @@
},
"ServerThemeDto": {
"properties": {
"theme": {
"$ref": "#/components/schemas/SystemConfigThemeDto"
"customCss": {
"type": "string"
}
},
"required": [
"theme"
"customCss"
],
"type": "object"
},

View File

@@ -80,9 +80,7 @@ export class ServerMediaTypesResponseDto {
sidecar!: string[];
}
export class ServerThemeDto {
theme!: SystemConfigThemeDto;
}
export class ServerThemeDto extends SystemConfigThemeDto {}
export class ServerConfigDto {
oauthButtonText!: string;

View File

@@ -72,7 +72,7 @@ export class ServerInfoService {
async getTheme() {
const { theme } = await this.configCore.getConfig();
return { theme };
return theme;
}
async getConfig(): Promise<ServerConfigDto> {

View File

@@ -161,9 +161,7 @@ describe(`${ServerInfoController.name} (e2e)`, () => {
const { status, body } = await request(server).get('/server-info/theme');
expect(status).toBe(200);
expect(body).toEqual({
theme: {
customCss: '',
},
customCss: '',
});
});
});