From 0aea6e5273f0128a62233eda3374f9cf62242473 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sat, 21 Mar 2026 21:46:58 +0000 Subject: [PATCH] Actualizar asignados.html --- asignados.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/asignados.html b/asignados.html index 21f0043..ac50a0f 100644 --- a/asignados.html +++ b/asignados.html @@ -189,9 +189,11 @@
-

Fecha Solicitada por el Cliente

-

--/--/----

-

--:--

+

Fecha y Hora de Cita (Modificable)

+
+ + +
@@ -415,8 +417,8 @@ document.getElementById('appRef').innerText = `Exp. #${req.service_ref || "S/R"}`; document.getElementById('appName').innerText = raw["Nombre Cliente"] || "Cliente"; - document.getElementById('appDate').innerText = formatDate(raw.requested_date); - document.getElementById('appTime').innerText = `Llegada aprox: ${raw.requested_time} - ${addOneHour(raw.requested_time)}`; + document.getElementById('appDateInput').value = raw.requested_date || ""; + document.getElementById('appTimeInput').value = raw.requested_time || ""; document.getElementById('appDurationInput').value = "60"; const modal = document.getElementById('approveModal'); @@ -430,6 +432,8 @@ async function approveRequest() { const id = document.getElementById('appId').value; const duration = document.getElementById('appDurationInput').value; + const date = document.getElementById('appDateInput').value; + const time = document.getElementById('appTimeInput').value; const btn = document.getElementById('btnApprove'); const originalContent = btn.innerHTML; btn.innerHTML = ``; @@ -439,7 +443,7 @@ const res = await fetch(`${API_URL}/agenda/requests/${id}/approve`, { method: 'POST', headers: { "Content-Type": "application/json", "Authorization": `Bearer ${localStorage.getItem("token")}` }, - body: JSON.stringify({ duration: duration }) + body: JSON.stringify({ duration: duration, date: date, time: time }) }); if (res.ok) { showToast("Cita Aceptada");