Skip to content

Commit

Permalink
front: Add TODO for empty array return in region API.
Browse files Browse the repository at this point in the history
Added a TODO comment in the API for regions to return an empty array
instead of null when the response status is 204 (No Content).

Issue: #189

Signed-off-by: Nikolay Martyanov <ohmspectator@gmail.com>
  • Loading branch information
OhmSpectator committed Dec 29, 2023
1 parent b6b71d0 commit 3d20fdf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +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 response.data;
Expand Down

0 comments on commit 3d20fdf

Please sign in to comment.