From cf1eddb449c9c21585abcb5960fd253766ed2b76 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Jun 2023 09:46:21 -0500 Subject: [PATCH] fix(server): transform isReadOnly DTO to boolean (#2912) --- server/src/immich/api-v1/asset/dto/create-asset.dto.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/immich/api-v1/asset/dto/create-asset.dto.ts b/server/src/immich/api-v1/asset/dto/create-asset.dto.ts index 946c0544e8..bf54d4ce30 100644 --- a/server/src/immich/api-v1/asset/dto/create-asset.dto.ts +++ b/server/src/immich/api-v1/asset/dto/create-asset.dto.ts @@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { ImmichFile } from '../../../config/asset-upload.config'; -import { toSanitized } from '../../../utils/transform.util'; +import { toBoolean, toSanitized } from '../../../utils/transform.util'; export class CreateAssetBase { @IsNotEmpty() @@ -41,6 +41,7 @@ export class CreateAssetBase { export class CreateAssetDto extends CreateAssetBase { @IsOptional() @IsBoolean() + @Transform(toBoolean) isReadOnly?: boolean = false; @IsNotEmpty() @@ -60,7 +61,7 @@ export class CreateAssetDto extends CreateAssetBase { export class ImportAssetDto extends CreateAssetBase { @IsOptional() - @IsBoolean() + @Transform(toBoolean) isReadOnly?: boolean = true; @IsString()