Actualizar configuracion.html

This commit is contained in:
2026-03-08 21:33:26 +00:00
parent 667fdf0856
commit a6a50eaab4

View File

@@ -1244,13 +1244,11 @@
}
async function saveRobotConfig() {
// Ponemos el botón en modo "Cargando..."
const btn = document.querySelector('button[onclick="saveRobotConfig()"]');
const originalHtml = btn.innerHTML;
btn.innerHTML = '<i data-lucide="loader-2" class="w-4 h-4 animate-spin"></i> Guardando...';
lucide.createIcons();
// Construimos SOLO el objeto del robot (el servidor ya se encarga de no borrar el de WhatsApp)
const payload = {
robot_homeserve: {
assign: {
@@ -1263,7 +1261,7 @@
date: {
enabled: document.getElementById('hs_cfg_date_enabled').checked,
status: document.getElementById('hs_cfg_date_status').value,
days_next: parseInt(document.getElementById('hs_cfg_date_days').value) || 0,
// Ya no guardamos "days_next" aquí, el servidor usará la fecha de la cita
check_inform: document.getElementById('hs_cfg_date_inform').checked,
obs: document.getElementById('hs_cfg_date_obs').value
},
@@ -1292,7 +1290,6 @@
} catch(e) {
showToast("❌ Error de conexión", true);
} finally {
// Restauramos el botón
btn.innerHTML = originalHtml;
lucide.createIcons();
}