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

API Response then(response) not equal catch(response) #122

Open
mean-cj opened this issue May 25, 2020 · 1 comment
Open

API Response then(response) not equal catch(response) #122

mean-cj opened this issue May 25, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mean-cj
Copy link

mean-cj commented May 25, 2020

Hello

I think plugin-axios response on catch() and then() same format is better
because then, catch inside method can be access this.model , this.entities

now

  • api response on then(response) format is response.response.data
  • api response on catch(response) format is response.data

catch() to same format as then() is ok.
or then response only data is ok.

return this.post('').then((response) => { console.log(response) })
2020-05-25_140219

return this.post('').catch((response) => { console.log(response) })
2020-05-25_140310

What are your thoughts on this matter?

@kiaking
Copy link
Member

kiaking commented May 28, 2020

Ah I didn't see this differences. Thank you for pointing out! We should look into this on the next iteration of Axios plugin.

@kiaking kiaking added the enhancement New feature or request label May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants