From 558444bcd09a4d1dd26d99e524d7b3c76b625aa0 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Wed, 11 Oct 2023 23:42:58 -0400 Subject: [PATCH] Reverting --- src/store/index.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index a63afed1..ba2194d6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1990,25 +1990,21 @@ function sortArrayOfObjectsByPropertyValue(arrayOfObjects, propertyName) { } function convertGlassPieceNamingForApi(glassArray) { - // check if array already converted. (likely when a session has been saved previously and then reloaded) if (!glassArray || glassArray.length === 0) return []; + // check if array already converted. (likely when a session has been saved previously and then reloaded) if (glassArray[0].location !== undefined) { return glassArray; } - // const converted = []; - // glassArray.forEach((glass) => { - // converted.push({ - // location: glass.glassLocation, - // name: glass.glassName - // }); - // }); - // return converted; - return glassArray.map((glass) => ({ - location: glass?.glassLocation, - name: glass?.glassName - })); + const converted = []; + glassArray.forEach((glass) => { + converted.push({ + location: glass.glassLocation, + name: glass.glassName + }); + }); + return converted; } function convertResultsForApi(resultsArray) {