Payload being an ass whenever the code runs on the server or client

This commit is contained in:
DrMint 2024-07-14 18:16:25 +02:00
parent 8fe41b3989
commit b0416b61db
1 changed files with 4 additions and 9 deletions

View File

@ -67,19 +67,14 @@ export const afterDeleteWebhook: AfterDeleteHook = async ({ collection, doc }) =
return doc; return doc;
}; };
if (!process.env.WEB_SERVER_HOOK_URL) throw new Error("Missing WEB_SERVER_HOOK_URL");
if (!process.env.WEB_SERVER_HOOK_TOKEN) throw new Error("Missing WEB_SERVER_HOOK_TOKEN");
if (!process.env.MEILISEARCH_HOOK_URL) throw new Error("Missing MEILISEARCH_HOOK_URL");
if (!process.env.MEILISEARCH_HOOK_TOKEN) throw new Error("Missing MEILISEARCH_HOOK_TOKEN");
const webhookTargets: { url: string; token: string }[] = [ const webhookTargets: { url: string; token: string }[] = [
{ {
url: process.env.WEB_SERVER_HOOK_URL, url: process.env.WEB_SERVER_HOOK_URL ?? "",
token: process.env.WEB_SERVER_HOOK_TOKEN, token: process.env.WEB_SERVER_HOOK_TOKEN ?? "",
}, },
{ {
url: process.env.MEILISEARCH_HOOK_URL, url: process.env.MEILISEARCH_HOOK_URL ?? "",
token: process.env.MEILISEARCH_HOOK_TOKEN, token: process.env.MEILISEARCH_HOOK_TOKEN ?? "",
}, },
]; ];