fix: harmonizar pesquisa e navegacao dos catalogos em QA
This commit is contained in:
@@ -24,7 +24,9 @@ export default function InvestmentMapPanel({
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
const params = new URLSearchParams(JSON.parse(key));
|
||||
setPoints(null); setError(''); setMissing([]);
|
||||
setPoints(null);
|
||||
setError('');
|
||||
setMissing([]);
|
||||
setAreas([]);
|
||||
fetch(`/api/v1/investment/map?${params}`, {
|
||||
signal: controller.signal,
|
||||
@@ -46,13 +48,21 @@ export default function InvestmentMapPanel({
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
if (!controller.signal.aborted) setError('Não foi possível concluir a pesquisa.');
|
||||
if (!controller.signal.aborted)
|
||||
setError('Não foi possível concluir a pesquisa.');
|
||||
});
|
||||
return () => controller.abort();
|
||||
}, [key, retry]);
|
||||
return (
|
||||
<section className="space-y-3">
|
||||
<SearchState loading={points === null && !error} error={error} total={(points?.length ?? 0) + missing.length} retry={() => setRetry(value => value + 1)} />
|
||||
<SearchState
|
||||
scope="Registos consultados pelo mapa"
|
||||
countLabel="registos, incluindo os que não têm coordenadas"
|
||||
loading={points === null && !error}
|
||||
error={error}
|
||||
total={(points?.length ?? 0) + missing.length}
|
||||
retry={() => setRetry((value) => value + 1)}
|
||||
/>
|
||||
<InteractiveInvestmentMap points={points} areas={areas} />
|
||||
<TerritoryGeometryPreview
|
||||
territoryId={
|
||||
|
||||
Reference in New Issue
Block a user