diff --git a/pages/api/availability/_get.ts b/pages/api/availability/_get.ts index 21450f005e..5289190c03 100644 --- a/pages/api/availability/_get.ts +++ b/pages/api/availability/_get.ts @@ -7,7 +7,7 @@ import { stringOrNumber } from "@calcom/prisma/zod-utils"; const availabilitySchema = z .object({ - userId: stringOrNumber.optional(), + userId: stringOrNumber, username: z.string().optional(), dateFrom: z.string(), dateTo: z.string(), diff --git a/pages/api/availability/index.ts b/pages/api/availability/index.ts index 0fe7836697..b0c4e223d5 100644 --- a/pages/api/availability/index.ts +++ b/pages/api/availability/index.ts @@ -1,5 +1,9 @@ import { defaultHandler } from "@calcom/lib/server"; -export default defaultHandler({ - GET: import("./_get"), -}); +import { withMiddleware } from "@lib/helpers/withMiddleware"; + +export default withMiddleware("HTTP_GET_OR_POST")( + defaultHandler({ + GET: import("./_get"), + }) +);