In the fetchSubregions function, there is a TODO comment suggesting that we should return an empty array instead of null when the response status is 204 (No Content). This change will make the return values consistent across different scenarios, enhancing the predictability and reliability of the function.
Requirements
[ ] Update the fetchSubregions function so that it returns an empty array [] instead of null when the response.status is 204.
[ ] Refactor any consuming code that expects null to handle an empty array accordingly.
Description
In the
fetchSubregions
function, there is a TODO comment suggesting that we should return an empty array instead of null when the response status is 204 (No Content). This change will make the return values consistent across different scenarios, enhancing the predictability and reliability of the function.Requirements
fetchSubregions
function so that it returns an empty array[]
instead ofnull
when theresponse.status
is 204.null
to handle an empty array accordingly.