-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] json api errors #3194
[WIP] json api errors #3194
Conversation
if (status === 422) { | ||
var errors = []; | ||
|
||
Object.keys(payload.errors).forEach(function(key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably check if payload.errors
is there or not
5385889
to
7fe469d
Compare
4c91a8f
to
8b8f6b3
Compare
export function errorsHashToArray(errors) { | ||
let out = []; | ||
|
||
if (Ember.isPresent(errors)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably use Ember.keys + a for loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
lgtm |
Lgtm |
This PR normalize internal representation of errors in ember data. It will align the representation of errors with json api spec errors
It do not change public api (
errors
object) for invalid errorsWe are deprecating
ajaxSuccess
andajaxError
in favor ofhandleRequest
. The main goal is to decoupleRESTAdapter
fromjQuery.ajax
.