cal.pub0.org/apps/api/lib/validations/shared/baseApiParams.ts

12 lines
469 B
TypeScript
Raw Permalink Normal View History

2022-03-30 12:17:55 +00:00
import { z } from "zod";
// Extracted out as utility function so can be reused
// at different endpoints that require this validation.
2022-12-05 23:09:19 +00:00
export const baseApiParams = z.object({
// since we added apiKey as query param this is required by next-validations helper
// for query params to work properly and not fail.
apiKey: z.string().optional(),
// version required for supporting /v1/ redirect to query in api as *?version=1
version: z.string().optional(),
});