2022-10-11 02:25:47 +00:00
|
|
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
|
|
|
|
|
|
import { defaultHandler, defaultResponder } from "@calcom/lib/server";
|
2022-06-29 22:01:14 +00:00
|
|
|
|
2022-11-25 13:56:58 +00:00
|
|
|
import { withMiddleware } from "~/lib/helpers/withMiddleware";
|
2022-06-29 22:01:14 +00:00
|
|
|
|
2022-10-11 02:25:47 +00:00
|
|
|
import authMiddleware from "./_auth-middleware";
|
|
|
|
|
2022-10-21 19:30:09 +00:00
|
|
|
export default withMiddleware()(
|
2022-10-11 02:25:47 +00:00
|
|
|
defaultResponder(async (req: NextApiRequest, res: NextApiResponse) => {
|
|
|
|
await authMiddleware(req);
|
|
|
|
return defaultHandler({
|
2022-06-29 22:01:14 +00:00
|
|
|
GET: import("./_get"),
|
|
|
|
PATCH: import("./_patch"),
|
|
|
|
DELETE: import("./_delete"),
|
2022-10-11 02:25:47 +00:00
|
|
|
})(req, res);
|
|
|
|
})
|
2022-06-29 22:01:14 +00:00
|
|
|
);
|