fix(bandeja): corregir res.data → top-level keys (jsonOk no anida en data)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
0c6e522106
commit
6c54674795
@@ -432,14 +432,14 @@ async function _bndRefrescarLista() {
|
||||
const res = await fetch(BND_API).then(r => r.json()).catch(() => null);
|
||||
if (!res?.ok) return;
|
||||
|
||||
_bndListData = res.data;
|
||||
const s = res.data.stats;
|
||||
_bndListData = res;
|
||||
const s = res.stats;
|
||||
document.getElementById('st-total').innerHTML = `<i class="fas fa-users"></i> Total: ${s.total}`;
|
||||
document.getElementById('st-activos').innerHTML = `<i class="fas fa-circle" style="font-size:.55rem"></i> Activos: ${s.activos}`;
|
||||
document.getElementById('st-cerr').innerHTML = `<i class="fas fa-check-double"></i> Cerrados: ${s.cerrados}`;
|
||||
document.getElementById('st-mp').innerHTML = `<i class="fas fa-exclamation-triangle"></i> Muestras pend.: ${s.muestras_pendientes}`;
|
||||
|
||||
_renderLista(res.data.activos, res.data.cerrados);
|
||||
_renderLista(res.activos, res.cerrados);
|
||||
}
|
||||
|
||||
function _renderLista(activos, cerrados) {
|
||||
@@ -491,7 +491,7 @@ async function _bndVerDetalle(turnoId) {
|
||||
const res = await fetch(`${BND_API}?turno_id=${turnoId}`).then(r => r.json()).catch(() => null);
|
||||
if (!res?.ok) { det.innerHTML = `<div class="bnd-empty"><i class="fas fa-times-circle"></i><p>Error al cargar</p></div>`; return; }
|
||||
|
||||
_renderDetalle(res.data);
|
||||
_renderDetalle(res);
|
||||
}
|
||||
|
||||
function _renderDetalle(d) {
|
||||
|
||||
Reference in New Issue
Block a user