Skip to content

Commit

Permalink
[23.0] Fix datasetStore.saveDatasets bug
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahmedhamidawan committed Feb 9, 2024
1 parent bed5c5e commit 948c013
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/store/historyStore/datasetStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
});
}
Expand Down

0 comments on commit 948c013

Please sign in to comment.