mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
* fix(server): non-admin cannot user map * fix: admin route --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { SystemConfigDto, SystemConfigService, SystemConfigTemplateStorageOptionDto } from '@app/domain';
|
|
import { MapThemeDto } from '@app/domain/system-config/system-config-map-theme.dto';
|
|
import { Body, Controller, Get, Put, Query } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { AdminRoute, Authenticated } from '../app.guard';
|
|
import { UseValidation } from '../app.utils';
|
|
|
|
@ApiTags('System Config')
|
|
@Controller('system-config')
|
|
@Authenticated({ admin: true })
|
|
@UseValidation()
|
|
export class SystemConfigController {
|
|
constructor(private readonly service: SystemConfigService) {}
|
|
|
|
@Get()
|
|
getConfig(): Promise<SystemConfigDto> {
|
|
return this.service.getConfig();
|
|
}
|
|
|
|
@Get('defaults')
|
|
getConfigDefaults(): SystemConfigDto {
|
|
return this.service.getDefaults();
|
|
}
|
|
|
|
@Put()
|
|
updateConfig(@Body() dto: SystemConfigDto): Promise<SystemConfigDto> {
|
|
return this.service.updateConfig(dto);
|
|
}
|
|
|
|
@Get('storage-template-options')
|
|
getStorageTemplateOptions(): SystemConfigTemplateStorageOptionDto {
|
|
return this.service.getStorageTemplateOptions();
|
|
}
|
|
|
|
@AdminRoute(false)
|
|
@Get('map/style.json')
|
|
getMapStyle(@Query() dto: MapThemeDto) {
|
|
return this.service.getMapStyle(dto.theme);
|
|
}
|
|
}
|