From 3554c0058e8cdebf5ec6ef8e5eeca967300ab214 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 01:04:41 +0000 Subject: [PATCH] Fix CORS handling Co-authored-by: Ichitux <17677572+Ichitux@users.noreply.github.com> --- src/components/BookingSection.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/BookingSection.tsx b/src/components/BookingSection.tsx index 7c6b630..075f5e8 100644 --- a/src/components/BookingSection.tsx +++ b/src/components/BookingSection.tsx @@ -55,14 +55,20 @@ const BookingSection = () => { setStatus("loading"); try { + console.log("[Booking] Sending to:", WEBHOOK_URL); + console.log("[Booking] Payload:", JSON.stringify(result.data)); const res = await fetch(WEBHOOK_URL, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(result.data), }); - if (!res.ok) throw new Error("Error en la solicitud"); + console.log("[Booking] Response status:", res.status, res.statusText); + const text = await res.text(); + console.log("[Booking] Response body:", text); + if (!res.ok) throw new Error(`HTTP ${res.status}: ${text}`); setStatus("success"); - } catch { + } catch (err) { + console.error("[Booking] Error:", err); setStatus("error"); } };