fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user