fix(lancar-gto): corrigir crash .map — getPacientes retorna {data,total} não array
This commit is contained in:
@@ -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();
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user