2022-07-08 17:21:40 +00:00
|
|
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
|
|
|
2022-10-11 01:46:45 +00:00
|
|
|
import { defaultHandler, defaultResponder } from "@calcom/lib/server";
|
2022-07-08 17:21:40 +00:00
|
|
|
|
|
|
|
import { withMiddleware } from "@lib/helpers/withMiddleware";
|
|
|
|
|
|
|
|
import authMiddleware from "./_auth-middleware";
|
|
|
|
|
2022-10-21 19:30:09 +00:00
|
|
|
export default withMiddleware()(
|
2022-10-11 01:46:45 +00:00
|
|
|
defaultResponder(async (req: NextApiRequest, res: NextApiResponse) => {
|
|
|
|
await authMiddleware(req);
|
|
|
|
return defaultHandler({
|
|
|
|
GET: import("./_get"),
|
|
|
|
PATCH: import("./_patch"),
|
|
|
|
DELETE: import("./_delete"),
|
|
|
|
})(req, res);
|
|
|
|
})
|
|
|
|
);
|