Ajax Error Service

This commit is contained in:
Matthew Dillon 2015-12-02 10:13:06 -07:00
parent 9496de21d9
commit 689ea55bed
2 changed files with 19 additions and 7 deletions

View file

@ -1,7 +0,0 @@
export default function ajaxErrorNew(error, flash) {
flash.clearMessages();
error.errors.forEach((error) => {
const source = error.source.pointer.split('/');
flash.error(`${source[source.length-1].replace(/([A-Z])/g, ' $1').capitalize()} - ${error.detail}`);
});
}