-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 토익 문제 조회 API에서 Query 파라미터 옵션 추가 - 기본으로 공개된 문제만 조회하도록 변경 Related to #35
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsOptional, Max, Min } from 'class-validator'; | ||
import { ToeicWhereInputProps } from '../toeic.interface'; | ||
import { Type } from 'class-transformer'; | ||
|
||
export class ToeicQueryParam { | ||
@ApiProperty({ | ||
description: '문제 공개 여부 (0: 비공개, 1: 공개)', | ||
required: false, | ||
default: 1, | ||
}) | ||
@Min(0) | ||
@Max(1) | ||
@IsOptional() | ||
@Type(() => Number) | ||
isPublic: number; | ||
|
||
getQueryProps(): ToeicWhereInputProps { | ||
return { | ||
is_public: | ||
typeof this.isPublic === 'undefined' ? true : Boolean(this.isPublic), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,7 @@ export interface PatchQuestionToEntity | |
}[]; | ||
}; | ||
} | ||
|
||
export interface ToeicWhereInputProps { | ||
is_public: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters