Actualizar configuracion.html
This commit is contained in:
@@ -1192,10 +1192,11 @@
|
||||
|
||||
async function loadRobotConfig() {
|
||||
try {
|
||||
const res = await fetch(`${API_URL}/whatsapp/settings`, { headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } });
|
||||
const res = await fetch(`${API_URL}/whatsapp/settings`, {
|
||||
headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` }
|
||||
});
|
||||
const data = await res.json();
|
||||
const s = data.settings || {};
|
||||
|
||||
const hsSettings = s.robot_homeserve || {};
|
||||
|
||||
// Cargar Asignación
|
||||
@@ -1205,17 +1206,16 @@
|
||||
document.getElementById('hs_cfg_assign_days').value = hsSettings.assign.days_next ?? 1;
|
||||
document.getElementById('hs_cfg_assign_inform').checked = hsSettings.assign.check_inform || false;
|
||||
document.getElementById('hs_cfg_assign_obs').value = hsSettings.assign.obs || "";
|
||||
toggleHsConfig('assign');
|
||||
if (hsSettings.assign.enabled) toggleHsConfig('assign');
|
||||
}
|
||||
|
||||
// Cargar Cita
|
||||
if (hsSettings.date) {
|
||||
document.getElementById('hs_cfg_date_enabled').checked = hsSettings.date.enabled;
|
||||
document.getElementById('hs_cfg_date_status').value = hsSettings.date.status || "307";
|
||||
// 👇 LÍNEA ELIMINADA AQUÍ (Ya no busca hs_cfg_date_days)
|
||||
document.getElementById('hs_cfg_date_inform').checked = hsSettings.date.check_inform || false;
|
||||
document.getElementById('hs_cfg_date_obs').value = hsSettings.date.obs || "";
|
||||
toggleHsConfig('date');
|
||||
if (hsSettings.date.enabled) toggleHsConfig('date');
|
||||
}
|
||||
|
||||
// Cargar No Localizado
|
||||
@@ -1225,7 +1225,7 @@
|
||||
document.getElementById('hs_cfg_notfound_days').value = hsSettings.notfound.days_next ?? 1;
|
||||
document.getElementById('hs_cfg_notfound_inform').checked = hsSettings.notfound.check_inform || false;
|
||||
document.getElementById('hs_cfg_notfound_obs').value = hsSettings.notfound.obs || "";
|
||||
toggleHsConfig('notfound');
|
||||
if (hsSettings.notfound.enabled) toggleHsConfig('notfound');
|
||||
}
|
||||
} catch(e) { console.error("Error cargando ajustes del robot", e); }
|
||||
}
|
||||
@@ -1248,7 +1248,6 @@
|
||||
date: {
|
||||
enabled: document.getElementById('hs_cfg_date_enabled').checked,
|
||||
status: document.getElementById('hs_cfg_date_status').value,
|
||||
// 👇 LÍNEA ELIMINADA AQUÍ (Ya no lee hs_cfg_date_days)
|
||||
check_inform: document.getElementById('hs_cfg_date_inform').checked,
|
||||
obs: document.getElementById('hs_cfg_date_obs').value
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user