Improve API error handling

- Change 'path' key to 'source.pointer', as per spec
- Add 500 error detail if debug mode is on
This commit is contained in:
Toby Zerner
2015-09-14 15:40:07 +09:30
parent b7d8afe6a4
commit 8cccaaaf6b
5 changed files with 54 additions and 27 deletions

View File

@ -129,7 +129,7 @@ export default class Modal extends Component {
m.redraw();
if (errors) {
this.$('form [name=' + errors[0].path + ']').select();
this.$('form [name=' + errors[0].source.pointer.replace('/data/attributes/', '') + ']').select();
} else {
this.$('form :input:first').select();
}