From 6b9ecea4f254828ead6af6dc269cec4f0eee359f Mon Sep 17 00:00:00 2001 From: kim jong hwa Date: Thu, 2 Nov 2023 15:50:12 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9E=91=EC=97=85=EC=A4=91]:=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/events/dto/create-event.dto.ts | 2 ++ src/events/events.controller.ts | 2 +- src/searches/searches.controller.ts | 2 +- src/searches/{searches.dto.ts => searches.dto}/searches.dto.ts | 1 - src/searches/searches.service.ts | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) rename src/searches/{searches.dto.ts => searches.dto}/searches.dto.ts (98%) diff --git a/src/events/dto/create-event.dto.ts b/src/events/dto/create-event.dto.ts index f3d637c..797458f 100644 --- a/src/events/dto/create-event.dto.ts +++ b/src/events/dto/create-event.dto.ts @@ -7,6 +7,7 @@ import { IsNotEmpty, MaxLength, Min, + Max, } from 'class-validator'; export class CreateEventDto { @@ -21,6 +22,7 @@ export class CreateEventDto { @IsInt() @IsNotEmpty() @Min(1) + @Max(50) @ApiProperty({ example: 10, }) diff --git a/src/events/events.controller.ts b/src/events/events.controller.ts index d143abb..2253ab9 100644 --- a/src/events/events.controller.ts +++ b/src/events/events.controller.ts @@ -64,7 +64,7 @@ export class EventsController { // 전체 조회 시 이벤트 호스트와 참가자 수 반환 const event = events.map((item) => { const { GuestEvents, HostEvents, ...rest } = item; - const hostUser = HostEvents[0].User.UserDetail; + const hostUser = HostEvents[0]?.User?.UserDetail || null return { event: rest, diff --git a/src/searches/searches.controller.ts b/src/searches/searches.controller.ts index 0899394..68fa51e 100644 --- a/src/searches/searches.controller.ts +++ b/src/searches/searches.controller.ts @@ -1,7 +1,7 @@ import { Controller, Get, Injectable, Query } from '@nestjs/common'; import { SearchesService } from './searches.service'; import { ApiTags, ApiOperation } from '@nestjs/swagger'; -import { SearchesDto } from './searches.dto.ts/searches.dto'; +import { SearchesDto } from './searches.dto/searches.dto'; @Controller('search') @Injectable() diff --git a/src/searches/searches.dto.ts/searches.dto.ts b/src/searches/searches.dto/searches.dto.ts similarity index 98% rename from src/searches/searches.dto.ts/searches.dto.ts rename to src/searches/searches.dto/searches.dto.ts index 52c4013..dc7b9d8 100644 --- a/src/searches/searches.dto.ts/searches.dto.ts +++ b/src/searches/searches.dto/searches.dto.ts @@ -39,6 +39,5 @@ export class SearchesDto { }) @IsOptional() @IsString() - @MinLength(2) keyWord: string } \ No newline at end of file diff --git a/src/searches/searches.service.ts b/src/searches/searches.service.ts index 84e85bc..c2fd622 100644 --- a/src/searches/searches.service.ts +++ b/src/searches/searches.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { PrismaService } from '../prisma/prisma.service'; -import { SearchesDto } from './searches.dto.ts/searches.dto'; +import { SearchesDto } from './searches.dto/searches.dto'; @Injectable() export class SearchesService {