mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-01 12:43:58 +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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user