From d6d54df384d1556dfa9a00b84f9e0d9e29e174e2 Mon Sep 17 00:00:00 2001 From: mouad bouras Date: Fri, 3 Apr 2026 14:29:01 -0400 Subject: [PATCH] reset --- src/pages/api/contact.ts | 4 ++-- src/pages/api/submission.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/api/contact.ts b/src/pages/api/contact.ts index 6317451..eb898ff 100644 --- a/src/pages/api/contact.ts +++ b/src/pages/api/contact.ts @@ -4,7 +4,6 @@ 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; @@ -90,10 +89,11 @@ 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) { - return new Response(JSON.stringify({ success: false, error: 'Server configuration missing.', apiKey, toAddress, fromAddress }), { + return new Response(JSON.stringify({ success: false, error: 'Server configuration missing.' }), { status: 500, headers: { 'Content-Type': 'application/json' }, }); diff --git a/src/pages/api/submission.ts b/src/pages/api/submission.ts index 22dafab..345d7cf 100644 --- a/src/pages/api/submission.ts +++ b/src/pages/api/submission.ts @@ -5,7 +5,6 @@ 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; @@ -215,6 +214,7 @@ 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();