fix: adds middleware, makes userId not optional

This commit is contained in:
Agusti Fernandez Pardo committed 2022-06-14 23:41:33 +02:00
1 parent e1bcd38e61
commit ba37ae78d9
2 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -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(),
+7 -3
View File
@@ -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"),
})
);