From f1c880690f47bddd5021a6ab4d3f365791ccb7a6 Mon Sep 17 00:00:00 2001 From: mouad bouras Date: Fri, 3 Apr 2026 14:26:58 -0400 Subject: [PATCH] top level env var --- src/pages/api/contact.ts | 2 +- src/pages/api/submission.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/contact.ts b/src/pages/api/contact.ts index 417bab3..6317451 100644 --- a/src/pages/api/contact.ts +++ b/src/pages/api/contact.ts @@ -4,6 +4,7 @@ import { sendEmail } from '@/lib/email'; import general from '@/content/settings/general.json'; export const prerender = false; +const apiKey = (env as any).RESEND_API_KEY; interface ContactBody { fullName: string; @@ -89,7 +90,6 @@ export const POST: APIRoute = async ({ request }) => { }); } - const apiKey = (env as unknown as Record).RESEND_API_KEY; const toAddress = general.emailToContact?.trim(); const fromAddress = general.emailFromContact?.trim(); if (!apiKey || !toAddress || !fromAddress) { diff --git a/src/pages/api/submission.ts b/src/pages/api/submission.ts index 345d7cf..22dafab 100644 --- a/src/pages/api/submission.ts +++ b/src/pages/api/submission.ts @@ -5,6 +5,7 @@ import { sendEmail } from '@/lib/email'; import general from '@/content/settings/general.json'; export const prerender = false; +const apiKey = (env as any).RESEND_API_KEY; const MAX_TOTAL_BYTES = 20 * 1024 * 1024; @@ -214,7 +215,6 @@ export const POST: APIRoute = async ({ request }) => { }); } - const apiKey = (env as unknown as Record).RESEND_API_KEY; const fromAddress = general.fromAddressSubmission?.trim(); const toAddress = general.toAddressSubmission?.trim();