mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server): improve validation in controllers (#2149)
* feat(server): improve validation in controllers * set ValidationPipe config with decorator
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
import { SystemConfig } from '@app/infra/entities';
|
||||
import { ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsObject, ValidateNested } from 'class-validator';
|
||||
import { SystemConfigFFmpegDto } from './system-config-ffmpeg.dto';
|
||||
import { SystemConfigOAuthDto } from './system-config-oauth.dto';
|
||||
import { SystemConfigPasswordLoginDto } from './system-config-password-login.dto';
|
||||
import { SystemConfigStorageTemplateDto } from './system-config-storage-template.dto';
|
||||
|
||||
export class SystemConfigDto {
|
||||
@Type(() => SystemConfigFFmpegDto)
|
||||
@ValidateNested()
|
||||
@IsObject()
|
||||
ffmpeg!: SystemConfigFFmpegDto;
|
||||
|
||||
@Type(() => SystemConfigOAuthDto)
|
||||
@ValidateNested()
|
||||
@IsObject()
|
||||
oauth!: SystemConfigOAuthDto;
|
||||
|
||||
@Type(() => SystemConfigPasswordLoginDto)
|
||||
@ValidateNested()
|
||||
@IsObject()
|
||||
passwordLogin!: SystemConfigPasswordLoginDto;
|
||||
|
||||
@Type(() => SystemConfigStorageTemplateDto)
|
||||
@ValidateNested()
|
||||
@IsObject()
|
||||
storageTemplate!: SystemConfigStorageTemplateDto;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user