Skip to content

Commit

Permalink
feat: coerce numbers for search params
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed Jun 23, 2024
1 parent 184a44d commit bce39c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routers/v2/logging/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const getLogsFiltersSchema = z.object({
lookup: f.lookupFilterValue.optional(),
environment: f.environment.optional(),
sort: z.enum(["ASC", "DESC"]).default("DESC"),
page: z.number().min(1).default(1),
page_size: z.number().min(1).default(50),
page: z.coerce.number().min(1).default(1),
page_size: z.coerce.number().min(1).default(50),
level: f.levelWithAll,
});

Expand Down
4 changes: 2 additions & 2 deletions src/routers/v2/services/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const f = {
export const createServiceSchema = z.object({});

export const getServiceFiltersSchema = z.object({
page: z.number().min(1).default(1),
page_size: z.number().min(1).default(50),
page: z.coerce.number().min(1).default(1),
page_size: z.coerce.number().min(1).default(50),
});

const serviceOutput = z.object({
Expand Down

0 comments on commit bce39c6

Please sign in to comment.