mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02: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:
parent
7ff68223ab
commit
a08a687951
4
cli/src/api/open-api/api.ts
generated
4
cli/src/api/open-api/api.ts
generated
@ -2966,10 +2966,10 @@ export interface ServerStatsResponseDto {
|
||||
export interface ServerThemeDto {
|
||||
/**
|
||||
*
|
||||
* @type {SystemConfigThemeDto}
|
||||
* @type {string}
|
||||
* @memberof ServerThemeDto
|
||||
*/
|
||||
'theme': SystemConfigThemeDto;
|
||||
'customCss': string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
BIN
mobile/openapi/doc/ServerThemeDto.md
generated
BIN
mobile/openapi/doc/ServerThemeDto.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/model/server_theme_dto.dart
generated
BIN
mobile/openapi/lib/model/server_theme_dto.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/server_theme_dto_test.dart
generated
BIN
mobile/openapi/test/server_theme_dto_test.dart
generated
Binary file not shown.
@ -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: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
4
web/src/api/open-api/api.ts
generated
4
web/src/api/open-api/api.ts
generated
@ -2966,10 +2966,10 @@ export interface ServerStatsResponseDto {
|
||||
export interface ServerThemeDto {
|
||||
/**
|
||||
*
|
||||
* @type {SystemConfigThemeDto}
|
||||
* @type {string}
|
||||
* @memberof ServerThemeDto
|
||||
*/
|
||||
'theme': SystemConfigThemeDto;
|
||||
'customCss': string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { RequestHandler, text } from '@sveltejs/kit';
|
||||
export const GET = (async ({ locals: { api } }) => {
|
||||
const {
|
||||
data: {
|
||||
theme: { customCss },
|
||||
},
|
||||
data: { customCss },
|
||||
} = await api.serverInfoApi.getTheme();
|
||||
return text(customCss, {
|
||||
headers: {
|
||||
|
Loading…
Reference in New Issue
Block a user