This commit is contained in:
Adria Navarro 2023-09-25 12:40:12 +02:00
parent a175fb3293
commit a834402e16
1 changed files with 4 additions and 1 deletions

View File

@ -72,10 +72,13 @@
const result = { const result = {
...optionsObj, ...optionsObj,
...(fetchResults || [])?.reduce((accumulator, row) => { ...(fetchResults || [])?.reduce((accumulator, row) => {
accumulator[row._id] = row if (!optionsObj[row._id]) {
accumulator[row._id] = row
}
return accumulator return accumulator
}, {}), }, {}),
} }
return Object.values(result) return Object.values(result)
} }
$: { $: {