Dynamic import fixes

pull/2651/head
zomars 2022-05-01 21:29:46 -06:00
parent c42b1e820b
commit 2e02b59bd0
1 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const appName = _appName.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
try {
const handler = (await import(`@calcom/app-store/${appName}/api/${apiEndpoint}`)) as NextApiHandler;
const handler = (await import(`@calcom/app-store/${appName}/api/${apiEndpoint}`))
.default as NextApiHandler;
if (typeof handler !== "function")
throw new HttpError({ statusCode: 404, message: `API handler not found` });