forked from Cutlery/immich
* feat: add admin config module for user configured config, uses it for ffmpeg * feat: add api endpoint to retrieve admin config settings and values * feat: add settings panel to admin page on web (wip) * feat: add api endpoint to update the admin config * chore: re-generate openapi spec after rebase * refactor: move from admin config to system config naming * chore: move away from UseGuards to new @Authenticated decorator * style: dark mode styling for lists and fix conflicting colors * wip: 2 column design, no edit button * refactor: system config * chore: generate open api * chore: rm broken test * chore: cleanup types * refactor: config module names Co-authored-by: Zack Pollard <zackpollard@ymail.com> Co-authored-by: Zack Pollard <zack.pollard@moonpig.com>
25 lines
935 B
TypeScript
25 lines
935 B
TypeScript
import { Body, Controller, Get, Put, ValidationPipe } from '@nestjs/common';
|
|
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
|
import { Authenticated } from '../../decorators/authenticated.decorator';
|
|
import { UpdateSystemConfigDto } from './dto/update-system-config';
|
|
import { SystemConfigResponseDto } from './response-dto/system-config-response.dto';
|
|
import { SystemConfigService } from './system-config.service';
|
|
|
|
@ApiTags('System Config')
|
|
@ApiBearerAuth()
|
|
@Authenticated({ admin: true })
|
|
@Controller('system-config')
|
|
export class SystemConfigController {
|
|
constructor(private readonly systemConfigService: SystemConfigService) {}
|
|
|
|
@Get()
|
|
getConfig(): Promise<SystemConfigResponseDto> {
|
|
return this.systemConfigService.getConfig();
|
|
}
|
|
|
|
@Put()
|
|
async updateConfig(@Body(ValidationPipe) dto: UpdateSystemConfigDto): Promise<SystemConfigResponseDto> {
|
|
return this.systemConfigService.updateConfig(dto);
|
|
}
|
|
}
|