diff --git a/deploy/datasets/query.js b/deploy/datasets/query.js index 778891655392974b125b3daa77fc29947ff773d6..d086d8c6f5426562c9959e84dd3472646e74d422 100644 --- a/deploy/datasets/query.js +++ b/deploy/datasets/query.js @@ -128,14 +128,16 @@ const getDs = ({ user }) => (user */ const existingEntryIdx = acc.findIndex(v => v['fullId'] === curr['fullId']) if (existingEntryIdx >= 0) { - const returnArr = [...acc].splice(existingEntryIdx, 1, { + const itemToReturn = { ...acc[existingEntryIdx], ...curr, parcellationRegion: [ ...(curr['parcellationRegion'] || []), ...(acc[existingEntryIdx]['parcellationRegion'] || []) ] - }) + } + const returnArr = [...acc] + returnArr.splice(existingEntryIdx, 1, itemToReturn) return returnArr } else return acc.concat(curr)