fix: add required property on input (#3934)
* fix: add required property on input * chore: remove console * fix: add check in /api/book for custom inputs * chore: var name * wip:try zod * fix: change zod validation Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Peer Richelsen
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent
85cc62d0cb
commit
00c00a9aee
@@ -87,6 +87,13 @@ export const bookingCreateBodySchema = z.object({
|
||||
hashedLink: z.string().nullish(),
|
||||
});
|
||||
|
||||
export const requiredCustomInputSchema = z.union([
|
||||
// string must be given & nonempty
|
||||
z.string().trim().min(1),
|
||||
// boolean must be true if set.
|
||||
z.boolean().refine((v) => v === true),
|
||||
]);
|
||||
|
||||
export type BookingCreateBody = z.input<typeof bookingCreateBodySchema>;
|
||||
|
||||
export const bookingConfirmPatchBodySchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user