Actualizar importar_todo.html

This commit is contained in:
2026-03-20 08:20:11 +00:00
parent 40ebdce31f
commit 018ae51fef

View File

@@ -165,8 +165,11 @@
const ref = document.getElementById("f_ref").value; const ref = document.getElementById("f_ref").value;
const isUrgent = document.getElementById("f_urgent").value === 'true'; const isUrgent = document.getElementById("f_urgent").value === 'true';
// Construimos el JSON idéntico a lo que leería el robot // 🛑 CORRECCIÓN: Hacemos el paquete "plano" para que la BD lo trague directo
const rawData = { const rawData = {
"service_ref": ref,
"status": "pending",
"is_urgent": isUrgent,
"Referencia": ref, "Referencia": ref,
"Nombre Cliente": document.getElementById("f_name").value, "Nombre Cliente": document.getElementById("f_name").value,
"Teléfono": document.getElementById("f_phone").value, "Teléfono": document.getElementById("f_phone").value,
@@ -181,14 +184,7 @@
const payload = { const payload = {
provider: "todo", provider: "todo",
services: [ services: [ rawData ] // Lo mandamos sin envoltorios extra
{
service_ref: ref,
status: "pending",
is_urgent: isUrgent,
raw_data: rawData
}
]
}; };
try { try {