2023-02-16 21:01:40 +00:00
|
|
|
import type { NextApiRequest, NextApiResponse } from "next";
|
2022-11-29 22:06:23 +00:00
|
|
|
|
|
|
|
import { defaultHandler, defaultResponder } from "@calcom/lib/server";
|
|
|
|
|
2022-12-08 23:28:28 +00:00
|
|
|
import { withMiddleware } from "~/lib/helpers/withMiddleware";
|
2022-11-29 22:06:23 +00:00
|
|
|
|
|
|
|
import { authMiddleware } from "./_auth-middleware";
|
|
|
|
|
|
|
|
export default withMiddleware()(
|
|
|
|
defaultResponder(async (req: NextApiRequest, res: NextApiResponse) => {
|
|
|
|
await authMiddleware(req);
|
|
|
|
return defaultHandler({
|
|
|
|
GET: import("./_get"),
|
|
|
|
PATCH: import("./_patch"),
|
|
|
|
DELETE: import("./_delete"),
|
|
|
|
})(req, res);
|
|
|
|
})
|
|
|
|
);
|