From 0bf1386be3cc7555cfedaae2d1020ec44c8537d8 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 8 Oct 2020 14:11:26 +0000 Subject: [PATCH] --- ayanova/src/api/gzform.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index f79534bf..0535b061 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -815,15 +815,26 @@ export default { //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 //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( - o - ) { - if (!o.target) { - return false; - } - return o.target.toLowerCase() == ref; - }); + + //de-lodash + // let m = window.$gz._.remove(vm.formState.serverError.details, function( + // o + // ) { + // if (!o.target) { + // return false; + // } + // 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 (