diff --git a/app/utils/ajax-error-new.js b/app/utils/ajax-error-new.js new file mode 100644 index 0000000..37031f2 --- /dev/null +++ b/app/utils/ajax-error-new.js @@ -0,0 +1,7 @@ +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}`); + }); +}