From b1d038383788e6aa4a8c6e2e3dc3566e83e734a9 Mon Sep 17 00:00:00 2001 From: Ricardo Silverio Date: Sat, 17 Feb 2024 21:21:36 -0300 Subject: [PATCH] Cloning item drafts before saving in closing app flow --- .../src/providers/ReduxStore/slices/collections/actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js index f083358264..f7747b75ae 100644 --- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js +++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js @@ -87,10 +87,11 @@ export const saveRequest = (itemUid, collectionUid) => (dispatch, getState) => { export const saveMultipleRequests = (items) => (dispatch, getState) => { const state = getState(); const { collections } = state.collections; + const clonedItems = cloneDeep(items); return new Promise((resolve, reject) => { const itemsToSave = []; - each(items, (item) => { + each(clonedItems, (item) => { const collection = findCollectionByUid(collections, item.collectionUid); if (collection) { const itemToSave = transformRequestToSaveToFilesystem(item);