AlexsLemonade / refinebio-web

Refinebio Web
https://staging.web.refine.bio
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Return ok and status properties on fetchAsync helper #329

Open nozomione opened 6 months ago

nozomione commented 6 months ago

Context

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