From 49a7230d0febcb1058d0aaa9eef841141cbb6ede Mon Sep 17 00:00:00 2001 From: AndrewMurtagh <22800080+AndrewMurtagh@users.noreply.github.com> Date: Fri, 17 Jan 2025 23:14:52 +0000 Subject: [PATCH] Allowing update params to be optional --- apps/server/src/device/dtos/update-device.dto.ts | 4 ++-- apps/server/src/image/dtos/update-image.dto.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/server/src/device/dtos/update-device.dto.ts b/apps/server/src/device/dtos/update-device.dto.ts index df07219..b796789 100644 --- a/apps/server/src/device/dtos/update-device.dto.ts +++ b/apps/server/src/device/dtos/update-device.dto.ts @@ -1,8 +1,8 @@ -import { IsNotEmpty, IsOptional, IsString, MaxLength, MinLength } from 'class-validator'; +import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator'; import { MAX_DESC_LEN, MAX_NAME_LEN, MIN_DESC_LEN, MIN_NAME_LEN } from '../../common/consts'; export class UpdateDeviceDto { - @IsNotEmpty() + @IsOptional() @IsString() @MinLength(MIN_NAME_LEN) @MaxLength(MAX_NAME_LEN) diff --git a/apps/server/src/image/dtos/update-image.dto.ts b/apps/server/src/image/dtos/update-image.dto.ts index 52a22bf..11b41e6 100644 --- a/apps/server/src/image/dtos/update-image.dto.ts +++ b/apps/server/src/image/dtos/update-image.dto.ts @@ -1,8 +1,8 @@ -import { IsNotEmpty, IsOptional, IsString, MaxLength, MinLength } from 'class-validator'; +import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator'; import { MAX_DESC_LEN, MAX_NAME_LEN, MIN_DESC_LEN, MIN_NAME_LEN } from '../../common/consts'; export class UpdateImageDto { - @IsNotEmpty() + @IsOptional() @IsString() @MinLength(MIN_NAME_LEN) @MaxLength(MAX_NAME_LEN)