-
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.
- Loading branch information
Showing
2 changed files
with
17 additions
and
16 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 |
---|---|---|
@@ -1,19 +1,4 @@ | ||
import { createZodDto } from 'nestjs-zod'; | ||
import { z } from 'nestjs-zod/z'; | ||
|
||
export const getHistoriesSchema = z.object({ | ||
who: z | ||
.enum(['all', 'my']) | ||
.describe( | ||
'모든 사용자의 기록을 볼 것인지, 본인의 기록만 볼 것인지 결정하는 필터', | ||
), | ||
query: z.string().optional().describe('검색어'), | ||
type: z | ||
.enum(['user', 'title', 'callsign', 'bookId']) | ||
.optional() | ||
.describe('어떤 값들로 검색하고 싶은지 결정하는 필터'), | ||
page: z.number().optional().describe('페이지 번호'), | ||
limit: z.number().optional().describe('한 페이지에 보여줄 항목 수'), | ||
}); | ||
import { getHistoriesSchema } from '../schema/histories.schema'; | ||
|
||
export class getHistoriesDto extends createZodDto(getHistoriesSchema) {} |
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,16 @@ | ||
import { z } from 'nestjs-zod/z'; | ||
|
||
export const getHistoriesSchema = z.object({ | ||
who: z | ||
.enum(['all', 'my']) | ||
.describe( | ||
'모든 사용자의 기록을 볼 것인지, 본인의 기록만 볼 것인지 결정하는 필터', | ||
), | ||
query: z.string().optional().describe('검색어'), | ||
type: z | ||
.enum(['user', 'title', 'callsign', 'bookId']) | ||
.optional() | ||
.describe('어떤 값들로 검색하고 싶은지 결정하는 필터'), | ||
page: z.number().optional().describe('페이지 번호'), | ||
limit: z.number().optional().describe('한 페이지에 보여줄 항목 수'), | ||
}); |