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