Skip to content

Commit

Permalink
refactor:
Browse files Browse the repository at this point in the history
  • Loading branch information
nyj001012 committed Sep 19, 2024
1 parent e252ae3 commit 10a12dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
17 changes: 1 addition & 16 deletions backend/src/histories/dto/histories.dto.ts
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) {}
16 changes: 16 additions & 0 deletions backend/src/histories/schema/histories.schema.ts
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('한 페이지에 보여줄 항목 수'),
});

0 comments on commit 10a12dd

Please sign in to comment.