From 8cf9aab987d8524bb29b2de4b288c6225bbebc55 Mon Sep 17 00:00:00 2001 From: Tomasz Magulski Date: Fri, 27 May 2022 14:52:05 +0200 Subject: [PATCH] Infer webhooks should use webhooks path relative to manifest API route --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 237df05..9c93739 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,10 +8,10 @@ const capitalize = (value: string) => const dropFileExtension = (filename: string) => path.parse(filename).name; -export const inferWebhooks = async (baseURL: string, generatedGraphQL: any) => { +export const inferWebhooks = async (baseURL: string, webhooksPath: string, generatedGraphQL: any) => { let entries; if (process.env.NODE_ENV === "production") { - entries = await fg(["*.js"], { cwd: `${__dirname}/webhooks` }); + entries = await fg(["*.js"], { cwd: webhooksPath }); } else { entries = await fg(["*.ts"], { cwd: `pages/api/webhooks` }); }