mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 06:39:57 +08:00
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:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user