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