fix(lancar-gto): corrigir crash .map — getPacientes retorna {data,total} não array

This commit is contained in:
VPS 4 Builder
2026-05-14 20:12:36 +02:00
parent 646458e669
commit a47f225bf9
+4 -4
View File
@@ -105,10 +105,10 @@ export const LancarGTO: React.FC = () => {
const d = await HybridBackend.getDentistas();
const es = await HybridBackend.getEspecialidades();
const pr = await HybridBackend.getProcedimentos();
setPacientes(p);
setDentistas(d);
setEspecialidades(es);
setProcedimentos(pr);
setPacientes(Array.isArray(p) ? p : (p?.data ?? []));
setDentistas(d ?? []);
setEspecialidades(es ?? []);
setProcedimentos(pr ?? []);
};
load();
}, []);