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.js
2015-10-14 10:27:18 -07:00

7 lines
236 B
JavaScript

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