Commit 948c0134 authored by Ahmed Awan's avatar Ahmed Awan
Browse files

[23.0] Fix `datasetStore.saveDatasets` bug

When we update the datasets in the `datasetStore`, we can sometimes set multiple properties to undefined.
This happens because a dataset in the store fetched from `/api/datasets/${id}` has a keys mismatch from a dataset coming from `/api/histories/${historyId}/contents` in `watchHistory`, where the latter has lesser keys.
To address this, I replaced 'localItem' with 'item' in the loop that updates the keys, ensuring the correct properties are retained during the store update.
parent bed5c5e2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ const mutations = {
                const id = item.id;
                if (state.items[id]) {
                    const localItem = state.items[id];
                    Object.keys(localItem).forEach((key) => {
                    Object.keys(item).forEach((key) => {
                        localItem[key] = item[key];
                    });
                }