Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Conversation

@rav3r
Copy link

@rav3r rav3r commented Jul 24, 2024

No description provided.

}

return {
status: response.status,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case if response json fail, response.status will be undefined, so let's set code 500 as fallback here

Suggested change
status: response.status,
status: response.status || 500,


return {
status: response.status,
message: errorBody?.message || "API request failed",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also add success: false to response object, to make response object parameters a bit more consistent.

Suggested change
message: errorBody?.message || "API request failed",
message: errorBody?.message || "API request failed",
success: false,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants