diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index 30427dd..91c282f 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -34,8 +34,7 @@ export const fetchSubregions = async (regionId, hierarchyId) => { try { const response = await api.get(`/api/regions/${regionId}/subregions`, { params: { hierarchyId } }); if (response.status === 204) { - // TODO return empty array instead of null, Issue #189 - return null; + return []; } return response.data; } catch (error) { diff --git a/frontend/src/components/RegionMap.jsx b/frontend/src/components/RegionMap.jsx index b1f0e5e..4382b69 100644 --- a/frontend/src/components/RegionMap.jsx +++ b/frontend/src/components/RegionMap.jsx @@ -64,9 +64,6 @@ function MapComponent() { // If region has subregions, fetch the subregions if (selectedRegion.hasSubregions) { const subregions = await fetchSubregions(selectedRegion.id, selectedHierarchy.hierarchyId); - if (subregions === null) { - return []; - } return subregions; } // If region does not have subregions, fetch the siblings