mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-01 21:21:06 +00:00
fix(openapi): Add openapi call after catch
fix: #2561 without making an explicit call to openapi a runtime error happens because it cannot infer the type, the call to openapi is the same across the codebase
This commit is contained in:
parent
72bf6f3c41
commit
b0a34fa21b
1 changed files with 12 additions and 1 deletions
|
|
@ -31,12 +31,23 @@ const listSiteResourcesQuerySchema = z.object({
|
|||
sort_by: z
|
||||
.enum(["name"])
|
||||
.optional()
|
||||
.catch(undefined),
|
||||
.catch(undefined)
|
||||
.openapi({
|
||||
type: "string",
|
||||
enum: ["name"],
|
||||
description: "Field to sort by"
|
||||
}),
|
||||
order: z
|
||||
.enum(["asc", "desc"])
|
||||
.optional()
|
||||
.default("asc")
|
||||
.catch("asc")
|
||||
.openapi({
|
||||
type: "string",
|
||||
enum: ["asc", "desc"],
|
||||
default: "asc",
|
||||
description: "Sort order"
|
||||
})
|
||||
});
|
||||
|
||||
export type ListSiteResourcesResponse = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue