Infer webhooks should use webhooks path relative to manifest API route
This commit is contained in:
parent
38a5c33bd4
commit
8cf9aab987
1 changed files with 2 additions and 2 deletions
|
@ -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` });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue