Adapter error deprecated.

This commit is contained in:
Matthew Dillon 2015-10-01 06:46:51 -07:00
parent da27b42f76
commit 69dbdcaa89

View file

@ -12,24 +12,6 @@ export default DS.RESTAdapter.extend({
coalesceFindRequests: true, coalesceFindRequests: true,
ajaxError: function(jqXHR) {
// http://stackoverflow.com/a/24027443
var error = this._super(jqXHR);
if (jqXHR && jqXHR.status === 422) {
var response = Ember.$.parseJSON(jqXHR.responseText),
errors = {};
if (response.errors !== undefined) {
var jsonErrors = response.errors;
Ember.EnumerableUtils.forEach(Object.keys(jsonErrors), function(key) {
errors[Ember.String.camelize(key)] = jsonErrors[key];
});
}
return new DS.InvalidError(errors);
} else {
return error;
}
},
shouldReloadAll: function() { shouldReloadAll: function() {
return true; return true;
}, },