fix fetch municipio
This commit is contained in:
@ -104,8 +104,8 @@ const AddDialog = () => {
|
|||||||
}, [formattedTime]);
|
}, [formattedTime]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
const fetchMunicipios = async (sorting: any) => {
|
||||||
const fetchMunicipios = async (sorting: any) => {
|
try {
|
||||||
sorting = sorting.length == 0 ? [{ id: 'name', desc: false }] : sorting;
|
sorting = sorting.length == 0 ? [{ id: 'name', desc: false }] : sorting;
|
||||||
const response = await GetData(`${API_URL}/municipios/list`, {
|
const response = await GetData(`${API_URL}/municipios/list`, {
|
||||||
limit: 100,
|
limit: 100,
|
||||||
@ -117,12 +117,12 @@ const AddDialog = () => {
|
|||||||
|
|
||||||
console.log(response?.data);
|
console.log(response?.data);
|
||||||
setMunicipios(response?.data.list);
|
setMunicipios(response?.data.list);
|
||||||
};
|
} catch (error) {
|
||||||
|
console.error('Error fetching municipios', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
fetchMunicipios([{ id: 'name', desc: false }]);
|
fetchMunicipios([{ id: 'name', desc: false }]);
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching municipios', error);
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user