Actualizar configuracion.html
This commit is contained in:
@@ -1244,13 +1244,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function saveRobotConfig() {
|
async function saveRobotConfig() {
|
||||||
// Ponemos el botón en modo "Cargando..."
|
|
||||||
const btn = document.querySelector('button[onclick="saveRobotConfig()"]');
|
const btn = document.querySelector('button[onclick="saveRobotConfig()"]');
|
||||||
const originalHtml = btn.innerHTML;
|
const originalHtml = btn.innerHTML;
|
||||||
btn.innerHTML = '<i data-lucide="loader-2" class="w-4 h-4 animate-spin"></i> Guardando...';
|
btn.innerHTML = '<i data-lucide="loader-2" class="w-4 h-4 animate-spin"></i> Guardando...';
|
||||||
lucide.createIcons();
|
lucide.createIcons();
|
||||||
|
|
||||||
// Construimos SOLO el objeto del robot (el servidor ya se encarga de no borrar el de WhatsApp)
|
|
||||||
const payload = {
|
const payload = {
|
||||||
robot_homeserve: {
|
robot_homeserve: {
|
||||||
assign: {
|
assign: {
|
||||||
@@ -1263,7 +1261,7 @@
|
|||||||
date: {
|
date: {
|
||||||
enabled: document.getElementById('hs_cfg_date_enabled').checked,
|
enabled: document.getElementById('hs_cfg_date_enabled').checked,
|
||||||
status: document.getElementById('hs_cfg_date_status').value,
|
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,
|
check_inform: document.getElementById('hs_cfg_date_inform').checked,
|
||||||
obs: document.getElementById('hs_cfg_date_obs').value
|
obs: document.getElementById('hs_cfg_date_obs').value
|
||||||
},
|
},
|
||||||
@@ -1292,7 +1290,6 @@
|
|||||||
} catch(e) {
|
} catch(e) {
|
||||||
showToast("❌ Error de conexión", true);
|
showToast("❌ Error de conexión", true);
|
||||||
} finally {
|
} finally {
|
||||||
// Restauramos el botón
|
|
||||||
btn.innerHTML = originalHtml;
|
btn.innerHTML = originalHtml;
|
||||||
lucide.createIcons();
|
lucide.createIcons();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user