From 9e74a33e07f6c274225eb3313ec633247ac1f381 Mon Sep 17 00:00:00 2001 From: GanghyeonSeo Date: Fri, 7 Jun 2024 19:50:28 +0900 Subject: [PATCH] fix: createPostDto arrayNotEmpty --- src/post/dto/req/CreatePost.dto.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/post/dto/req/CreatePost.dto.ts b/src/post/dto/req/CreatePost.dto.ts index 8a4b843..ca85cdf 100644 --- a/src/post/dto/req/CreatePost.dto.ts +++ b/src/post/dto/req/CreatePost.dto.ts @@ -1,5 +1,10 @@ import { ApiProperty } from '@nestjs/swagger'; -import { IsNotEmpty, IsString, MaxLength } from 'class-validator'; +import { + IsNotEmpty, + IsString, + MaxLength, + ArrayNotEmpty, +} from 'class-validator'; export class CreatePostDto { @ApiProperty({ @@ -28,5 +33,6 @@ export class CreatePostDto { }) @IsString({ each: true }) @IsNotEmpty() + @ArrayNotEmpty() imageUrls: string[] = []; }