Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definitions missing error object in return type #96

Open
vettloffah opened this issue Mar 28, 2023 · 0 comments
Open

Type definitions missing error object in return type #96

vettloffah opened this issue Mar 28, 2023 · 0 comments

Comments

@vettloffah
Copy link

When an api call doesn't succeed, there is an "errors" property returned from swellj-s. For example:

const cart = await swell.cart.get()
if(cart.errors){
 // handle errors
}

This isn't accounted for the in the type definitions. The return type is just Promise<swell.Cart> and Cart doesn't include errors so trying to handle errors is showing a type error warning as of swell-js 3.21.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant