feat: adds paymentID and allow attendeeEmail filtering in Booking API (#9143)
* adds payment id to return in GET bookings * Delete .gitkeep. Unintended * Delete Licenses. Unintended commit * initial working code for attendeeEmails filter * improve code readability * adds multiAttendee validation akin to multi userId * code improvement * adds swagger format email
This commit is contained in:
1 parent
1382d3bc56
commit
885bfdade4
5 files changed
+222
-68
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { withValidation } from "next-validations";
|
||||
import { z } from "zod";
|
||||
|
||||
import { baseApiParams } from "./baseApiParams";
|
||||
|
||||
// Extracted out as utility function so can be reused
|
||||
// at different endpoints that require this validation.
|
||||
export const schemaQueryAttendeeEmail = baseApiParams.extend({
|
||||
attendeeEmail: z.string().email(),
|
||||
});
|
||||
|
||||
export const schemaQuerySingleOrMultipleAttendeeEmails = z.object({
|
||||
attendeeEmail: z.union([z.string().email(), z.array(z.string().email())]).optional(),
|
||||
});
|
||||
|
||||
export const withValidQueryAttendeeEmail = withValidation({
|
||||
schema: schemaQueryAttendeeEmail,
|
||||
type: "Zod",
|
||||
mode: "query",
|
||||
});
|
||||
Reference in new issue
Block a user