From fbdc376cd1bae38abd176672c3f5dc66012fdde2 Mon Sep 17 00:00:00 2001 From: Sandhya Govindaraju Date: Fri, 22 Nov 2024 15:32:11 -0600 Subject: [PATCH] PR: rename variable --- src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 79c9efe..c36c50f 100644 --- a/src/index.js +++ b/src/index.js @@ -40,11 +40,11 @@ let defaultGetSnapshot = form => F.flattenObject(toJS(gatherFormValues(form))) let defaultGetNestedSnapshot = form => F.unflattenObject(form.getSnapshot()) // Splice the form errors when a array item is removed -const spliceErrors = (errors, parent, nodePosition) => { - const parentPath = parent.join('.') - const parentLength = parent.length - const arrayErrors = pickByPrefixes([parentPath], errors) - const newErrors = omitByPrefixes([parentPath], errors) +const spliceErrors = (errors, parentPath, nodePosition) => { + const parent = parentPath.join('.') + const parentLength = parentPath.length + const arrayErrors = pickByPrefixes([parent], errors) + const newErrors = omitByPrefixes([parent], errors) for (const [key, value] of Object.entries(arrayErrors)) { const keyFields = key.split('.') const idx = parseInt(keyFields[parentLength])