fix: complete InvesteMoz validation and error corrections

This commit is contained in:
2026-10-29 21:47:33 +02:00
parent 63147312e2
commit daf8623441
718 changed files with 127308 additions and 20959 deletions
@@ -15,7 +15,9 @@ export default function TerritoryAssociations() {
const [retry, setRetry] = useState(0);
useEffect(() => {
const controller = new AbortController();
setLoading(true); setError(''); setRows([]);
setLoading(true);
setError('');
setRows([]);
const timer = setTimeout(async () => {
try {
const params = new URLSearchParams({
@@ -41,10 +43,10 @@ export default function TerritoryAssociations() {
setError('');
} catch {
if (!controller.signal.aborted)
setError(
'Não foi possível concluir a pesquisa.',
);
} finally { if (!controller.signal.aborted) setLoading(false); }
setError('Não foi possível concluir a pesquisa.');
} finally {
if (!controller.signal.aborted) setLoading(false);
}
}, 250);
return () => {
clearTimeout(timer);
@@ -76,7 +78,12 @@ export default function TerritoryAssociations() {
<option value="opportunities">Oportunidades</option>
</select>
</Field>
<SearchState loading={loading} error={error} total={rows.length} retry={() => setRetry(value => value + 1)} />
<SearchState
loading={loading}
error={error}
total={rows.length}
retry={() => setRetry((value) => value + 1)}
/>
<Field label="Pesquisar investimento">
<input
className={control}