From 289b54cbd11e6a1c1b820920fccbda0b771b3633 Mon Sep 17 00:00:00 2001 From: Martin Fosco Date: Wed, 19 May 2021 19:42:10 -0300 Subject: [PATCH] Add clonedeep to value taken from getState() --- src/redux/actions/samples/updateSample.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redux/actions/samples/updateSample.js b/src/redux/actions/samples/updateSample.js index da72daaa11..0c382da44c 100644 --- a/src/redux/actions/samples/updateSample.js +++ b/src/redux/actions/samples/updateSample.js @@ -1,4 +1,6 @@ import moment from 'moment'; +import _ from 'lodash'; + import saveSamples from './saveSamples'; import { @@ -13,7 +15,7 @@ const updateSample = ( sampleUuid, diff, ) => async (dispatch, getState) => { - const sample = getState().samples[sampleUuid]; + const sample = _.cloneDeep(getState().samples[sampleUuid]); // eslint-disable-next-line no-param-reassign diff.lastModified = moment().toISOString();