diff --git a/src/app/page.tsx b/src/app/page.tsx index 0ffb211..268f149 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -22,12 +22,19 @@ export default function LandingPage() { const handleReserve = async () => { const message = encodeURIComponent(`Hello, I would like to book a table at Shaffa. \nName: ${name}\nEmail: ${email}\nMobile: ${mobile}\nGuests: ${guests}`); - // Send email via simple API request + // Send email via API request try { - await fetch('/api/send-booking', { + const response = await fetch('/api/send-booking', { method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, body: JSON.stringify({ name, email, mobile, guests, to: 'isittrueorjust@gmail.com' }), }); + + if (!response.ok) { + console.error("Server error during booking submission"); + } } catch (e) { console.error("Failed to send email", e); } @@ -207,4 +214,4 @@ export default function LandingPage() { ); -} +} \ No newline at end of file