Skip to content

Commit

Permalink
[#51] ImageURL 필드의 중첩된 구조도 검사할 수 있도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yeseul106 committed Sep 29, 2023
1 parent 6d5e8fd commit 77a96e1
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ import {
} from 'class-validator';
import { ImageURL } from 'src/entity/meeting/interface/image-url.interface';

/**
* ImageURL 정보
*/
class PostV1GetPostResponseImageUrlDto implements ImageURL {
@IsNotEmpty()
@IsNumber()
id: number;

@IsNotEmpty()
@IsString()
url: string;
}

/**
* 작성자 정보
*/
Expand Down Expand Up @@ -46,8 +59,10 @@ class PostV1GetPostResponseMeetingDto {
title: string;

/** 모임 이미지 */
@IsNotEmpty()
imageURL: ImageURL[];
@IsInstance(PostV1GetPostResponseImageUrlDto)
@ValidateNested({ each: true })
@Type(() => PostV1GetPostResponseImageUrlDto)
imageURL: PostV1GetPostResponseImageUrlDto[];

/** 모임 카테고리 */
@IsNotEmpty()
Expand Down

0 comments on commit 77a96e1

Please sign in to comment.