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
response 422 code status #64
Comments
Please propose a concrete scenario, including what you'd attempt to persist, the response you'd expect to get back, and how you'd expect the addon to behave. There's some automatic error handling in ember-data that goes with implementing the JSON-API standard, but this is a more general addon that doesn't assume anything about your UI/API contracts |
If i use default ember action save
And if response is 422 than model has errors.
And if i use custom action
And if response is 422 than model has no errors.
|
Yes.. You need to push the response.errors to Ds.invalidErrors and/or Ds.Error |
This is beyond the scope of this addon. ember-api-actions makes no assumptions about the nature of your payload (i.e., whether you're passing a model to your API at all), so handling validation errors wouldn't make sense as a default. What we could do is provide a standard pattern for dealing with errors in the README |
@denniscastro to get this behavior works check my package with implemented push to store option. |
Hi.
Good addon, but what about when response is 422 and ember return and DS.invalidError object?
The text was updated successfully, but these errors were encountered: