-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
How to handleDS.errors? #118
Comments
You can do something like this const Validations = buildValidations({
foo: validator(function(value, options, model, attribute) {
if (model.get('errors').has(attribute)) {
return model.get(`errors.${attribute}.messages.firstObject`);
}
return true;
}, { dependentKeys: ['errors.foo.messages.[]']})
}); |
it is not working for embedded belongs to and has many relationships.. |
You have to put your validations on the model that has the errors. You cant validate On a side note: @blimmer is this the sort of issue you have been facing as well? Would it help to have a |
@offirgolan that would be helpful - it would be especially helpful if it could identify the model property and mark that invalid (e.g. on a user form, highlight what is invalid like birthdate). |
@thiyagu06 |
Is there any code need be wriiten if server throws 422 errors.The one which is mentioned in the below link.
http://emberjs.com/api/data/classes/DS.Errors.html
The text was updated successfully, but these errors were encountered: