fix: adds middleware, makes userId not optional
parent
e1bcd38e61
commit
ba37ae78d9
|
@ -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(),
|
||||||
|
|
|
@ -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"),
|
||||||
});
|
})
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue