Skip to content

Commit

Permalink
[BIOMAGE-1109] Fix metadata not saving (#329)
Browse files Browse the repository at this point in the history
* Remove no longer used sample ids and remove properties that aren't samples from the updates

* Remove samples extra loading

* Fix tsts

* Fix
  • Loading branch information
cosa65 authored Jun 14, 2021
1 parent db0f619 commit df1da93
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ Object {
"asd123",
"qwe234",
],
"loading": false,
"meta": Object {
"error": false,
"loading": false,
Expand Down
4 changes: 3 additions & 1 deletion src/redux/actions/projects/createMetadataTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const createMetadataTrack = (
},
});

await Promise.all(Object.entries(samples).map(([sampleUuid, sample]) => dispatch({
const { meta, loading, ...onlySamples } = samples;

await Promise.all(Object.entries(onlySamples).map(([sampleUuid, sample]) => dispatch({
type: SAMPLES_UPDATE,
payload: {
sampleUuid,
Expand Down
4 changes: 1 addition & 3 deletions src/redux/actions/projects/deleteMetadataTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const deleteMetadataTrack = (
...curr,
[sampleUuid]: updatedSample,
};
}, {
ids: project.samples,
});
}, {});

try {
await dispatch(saveProject(projectUuid, newProject, false));
Expand Down
4 changes: 1 addition & 3 deletions src/redux/actions/projects/updateMetadataTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ const updateMetadataTrack = (
...curr,
[sampleUuid]: updatedSample,
};
}, {
ids: project.samples,
});
}, {});

try {
await dispatch(saveProject(projectUuid, newProject, false));
Expand Down
1 change: 0 additions & 1 deletion src/redux/reducers/samples/samplesLoaded.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const samplesLoad = (state, action) => {
const { samples } = action.payload;
return {
...state,
loading: false,
meta: {
...state.meta,
loading: false,
Expand Down

0 comments on commit df1da93

Please sign in to comment.