fix: correct API response path for lugar formularios in recepcion
- API returns json.formularios, not json.data.formularios - Now consents will properly display when selecting a lugar - Fixes issue where configured consents were not appearing in recepcion Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
8a5e57cebe
commit
5b02be6686
@@ -480,12 +480,12 @@ async function onLugarChange() {
|
|||||||
try {
|
try {
|
||||||
const res = await fetch(`${API}get_lugar_formularios.php?lugar_id=${lugarId}`);
|
const res = await fetch(`${API}get_lugar_formularios.php?lugar_id=${lugarId}`);
|
||||||
const json = await res.json();
|
const json = await res.json();
|
||||||
if (!json.ok || !json.data?.formularios?.length) {
|
if (!json.ok || !json.formularios?.length) {
|
||||||
sec.style.display = 'none';
|
sec.style.display = 'none';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lista.innerHTML = json.data.formularios.map(f => {
|
lista.innerHTML = json.formularios.map(f => {
|
||||||
const nom = escHtml(f.nombre);
|
const nom = escHtml(f.nombre);
|
||||||
const disabled = !turnoActivo ? 'disabled title="Llama el turno primero"' : '';
|
const disabled = !turnoActivo ? 'disabled title="Llama el turno primero"' : '';
|
||||||
return `<div class="consent-item pendiente">
|
return `<div class="consent-item pendiente">
|
||||||
|
|||||||
Reference in New Issue
Block a user