Mejoró logs de reserva
Ajusté el envío de reservas para facilitar diagnóstico: - Eliminé encabezados JSON en preflight y logeo detallado de request/response. - Mantiene envío a webhook, pero ahora registra URL, payload y respuesta para identificar problemas de CORS y status. X-Lovable-Edit-ID: edt-1e79ec7d-4dbb-45b5-82d0-b8489e8bdb01 Co-authored-by: Ichitux <17677572+Ichitux@users.noreply.github.com>
This commit is contained in:
@@ -56,16 +56,13 @@ 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),
|
||||
});
|
||||
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}`);
|
||||
console.log("[Booking] Response status:", res.status);
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
setStatus("success");
|
||||
} catch (err) {
|
||||
console.error("[Booking] Error:", err);
|
||||
|
||||
Reference in New Issue
Block a user