fix: adds middleware, makes userId not optional

pull/9078/head
Agusti Fernandez Pardo 2022-06-14 23:41:33 +02:00
parent e1bcd38e61
commit ba37ae78d9
2 changed files with 8 additions and 4 deletions

View File

@ -7,7 +7,7 @@ import { stringOrNumber } from "@calcom/prisma/zod-utils";
const availabilitySchema = z const availabilitySchema = z
.object({ .object({
userId: stringOrNumber.optional(), userId: stringOrNumber,
username: z.string().optional(), username: z.string().optional(),
dateFrom: z.string(), dateFrom: z.string(),
dateTo: z.string(), dateTo: z.string(),

View File

@ -1,5 +1,9 @@
import { defaultHandler } from "@calcom/lib/server"; import { defaultHandler } from "@calcom/lib/server";
export default defaultHandler({ import { withMiddleware } from "@lib/helpers/withMiddleware";
export default withMiddleware("HTTP_GET_OR_POST")(
defaultHandler({
GET: import("./_get"), GET: import("./_get"),
}); })
);