mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-09 18:55:50 +00:00
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:
@@ -7836,12 +7836,12 @@
|
||||
},
|
||||
"ServerThemeDto": {
|
||||
"properties": {
|
||||
"theme": {
|
||||
"$ref": "#/components/schemas/SystemConfigThemeDto"
|
||||
"customCss": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"theme"
|
||||
"customCss"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
|
||||
@@ -80,9 +80,7 @@ export class ServerMediaTypesResponseDto {
|
||||
sidecar!: string[];
|
||||
}
|
||||
|
||||
export class ServerThemeDto {
|
||||
theme!: SystemConfigThemeDto;
|
||||
}
|
||||
export class ServerThemeDto extends SystemConfigThemeDto {}
|
||||
|
||||
export class ServerConfigDto {
|
||||
oauthButtonText!: string;
|
||||
|
||||
@@ -72,7 +72,7 @@ export class ServerInfoService {
|
||||
|
||||
async getTheme() {
|
||||
const { theme } = await this.configCore.getConfig();
|
||||
return { theme };
|
||||
return theme;
|
||||
}
|
||||
|
||||
async getConfig(): Promise<ServerConfigDto> {
|
||||
|
||||
@@ -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: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user