mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
fix(server): transform isReadOnly DTO to boolean (#2912)
This commit is contained in:
parent
e171fec5aa
commit
cf1eddb449
@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger';
|
|||||||
import { Transform } from 'class-transformer';
|
import { Transform } from 'class-transformer';
|
||||||
import { IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
import { IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||||
import { ImmichFile } from '../../../config/asset-upload.config';
|
import { ImmichFile } from '../../../config/asset-upload.config';
|
||||||
import { toSanitized } from '../../../utils/transform.util';
|
import { toBoolean, toSanitized } from '../../../utils/transform.util';
|
||||||
|
|
||||||
export class CreateAssetBase {
|
export class CreateAssetBase {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@ -41,6 +41,7 @@ export class CreateAssetBase {
|
|||||||
export class CreateAssetDto extends CreateAssetBase {
|
export class CreateAssetDto extends CreateAssetBase {
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
|
@Transform(toBoolean)
|
||||||
isReadOnly?: boolean = false;
|
isReadOnly?: boolean = false;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@ -60,7 +61,7 @@ export class CreateAssetDto extends CreateAssetBase {
|
|||||||
|
|
||||||
export class ImportAssetDto extends CreateAssetBase {
|
export class ImportAssetDto extends CreateAssetBase {
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsBoolean()
|
@Transform(toBoolean)
|
||||||
isReadOnly?: boolean = true;
|
isReadOnly?: boolean = true;
|
||||||
|
|
||||||
@IsString()
|
@IsString()
|
||||||
|
Loading…
Reference in New Issue
Block a user