diff --git a/src/notice/dtos/NoticeListResponse.dto.ts b/src/notice/dtos/NoticeListResponse.dto.ts index 3dde76d..02bee34 100644 --- a/src/notice/dtos/NoticeListResponse.dto.ts +++ b/src/notice/dtos/NoticeListResponse.dto.ts @@ -18,10 +18,10 @@ export class NoticeListResponseDto { date: string; @ApiProperty({ - description: '전처리된 카테고리 정보', + description: '카테고리 정보', example: '학사일정', }) - mappedCategory: string; + category: string; @ApiProperty({ description: '학과 정보', example: '컴퓨터학과' }) provider: string; @@ -44,7 +44,7 @@ export class NoticeListResponseDto { this.scrapped = scrapBoxIds.length > 0; this.date = entity.date; this.provider = entity.category.provider.name; - this.mappedCategory = entity.category.mappedCategory; + this.category = entity.category.name; this.scrapBoxId = scrapBoxIds; } } diff --git a/src/notice/notice.service.ts b/src/notice/notice.service.ts index 733a330..e4bd910 100644 --- a/src/notice/notice.service.ts +++ b/src/notice/notice.service.ts @@ -63,7 +63,7 @@ export class NoticeService { }); if (categoryList.length > 0) { - queryBuilder.andWhere('category.mappedCategory IN (:...categoryList)', { + queryBuilder.andWhere('category.name IN (:...categoryList)', { categoryList, }); } diff --git a/src/pipes/stringValidation.pipe.ts b/src/pipes/stringValidation.pipe.ts index 6fc43c1..69895d8 100644 --- a/src/pipes/stringValidation.pipe.ts +++ b/src/pipes/stringValidation.pipe.ts @@ -3,13 +3,12 @@ import { Injectable, ArgumentMetadata, NotAcceptableException, - BadRequestException, } from '@nestjs/common'; @Injectable() export class StringValidationPipe implements PipeTransform { transform(value: string, metadata: ArgumentMetadata): string { - if (typeof value !== 'string') { + if (value !== undefined && typeof value !== 'string') { throw new NotAcceptableException( `입력값이 유효하지 않습니다 - <${metadata.data}> 해당 변수는 문자열이어야 합니다.`, );