This commit is contained in:
2020-10-08 14:11:26 +00:00
parent a049322a20
commit 0bf1386be3

View File

@@ -815,15 +815,26 @@ export default {
//If ref appears in the formState.serverErrors details collection, remove each one //If ref appears in the formState.serverErrors details collection, remove each one
//m is a mutated array with only the remaining (not removed) elements left //m is a mutated array with only the remaining (not removed) elements left
//that did NOT pass the truthy test function //that did NOT pass the truthy test function
Use Array.filter to do the opposite of this basically as a lodash replacement
let m = window.$gz._.remove(vm.formState.serverError.details, function( //de-lodash
o // let m = window.$gz._.remove(vm.formState.serverError.details, function(
) { // o
if (!o.target) { // ) {
return false; // if (!o.target) {
} // return false;
return o.target.toLowerCase() == ref; // }
}); // return o.target.toLowerCase() == ref;
// });
let m = [];
if (vm.formState.serverError.details) {
m = vm.formState.serverError.details.filter(function(o) {
if (o.target) {
return false;
}
return o.target.toLowerCase() != ref;
});
}
//If there are no more errors in details then remove the whole thing as it's no longer required //If there are no more errors in details then remove the whole thing as it's no longer required
if ( if (