parent
007de178d8
commit
8577c38a9f
11 changed files with 40 additions and 29 deletions
7
app/utils/ajax-error.js
Normal file
7
app/utils/ajax-error.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default function ajaxError(errors, flash) {
|
||||
flash.clearMessages();
|
||||
errors.forEach((error) => {
|
||||
console.log(error);
|
||||
flash.error(`${error.attribute.replace(/([A-Z])/g, ' $1').capitalize()} - ${error.message}`);
|
||||
});
|
||||
}
|
Reference in a new issue