Skip to content

Commit

Permalink
Merge pull request #33 from DevKor-github/feat/rho
Browse files Browse the repository at this point in the history
Feat/rho
  • Loading branch information
overthestream authored May 21, 2024
2 parents f8e0a6d + 5453b50 commit 5489d35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/notice/dtos/NoticeListResponse.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export class NoticeListResponseDto {
date: string;

@ApiProperty({
description: '전처리된 카테고리 정보',
description: '카테고리 정보',
example: '학사일정',
})
mappedCategory: string;
category: string;

@ApiProperty({ description: '학과 정보', example: '컴퓨터학과' })
provider: string;
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/notice/notice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class NoticeService {
});

if (categoryList.length > 0) {
queryBuilder.andWhere('category.mappedCategory IN (:...categoryList)', {
queryBuilder.andWhere('category.name IN (:...categoryList)', {
categoryList,
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/pipes/stringValidation.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import {
Injectable,
ArgumentMetadata,
NotAcceptableException,
BadRequestException,
} from '@nestjs/common';

@Injectable()
export class StringValidationPipe implements PipeTransform<string, string> {
transform(value: string, metadata: ArgumentMetadata): string {
if (typeof value !== 'string') {
if (value !== undefined && typeof value !== 'string') {
throw new NotAcceptableException(
`입력값이 유효하지 않습니다 - <${metadata.data}> 해당 변수는 문자열이어야 합니다.`,
);
Expand Down

0 comments on commit 5489d35

Please sign in to comment.