Currently, when the API server status is 200 (success), the fetchAsync helper returns the result (e.g., resource for dataset, search results), but it does not include the status and ok properties. They are only included in the case of a server error.
By including those properties by default allows us to set our applications states for errors and resources based on that status returned by the server.
Problem or idea
We should refactor the fetchAsync helper to always return the server status and ok properties regardless of a server status (error or success).
Solution or next step
Refactor the fetchAsync helper to return the status and ok properties by default
Based on the above change, adjust the codebase accordingly
Context
Currently, when the API server status is
200
(success), thefetchAsync
helper returns the result (e.g., resource for dataset, search results), but it does not include thestatus
andok
properties. They are only included in the case of a server error.By including those properties by default allows us to set our applications states for errors and resources based on that status returned by the server.
Problem or idea
We should refactor the
fetchAsync
helper to always return the serverstatus
andok
properties regardless of a server status (error or success).Solution or next step
fetchAsync
helper to return thestatus
andok
properties by default