This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
hymenobacterdotinfo/app/utils/ajax-error-new.js
2015-11-13 13:43:46 -07:00

7 lines
279 B
JavaScript

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}`);
});
}