mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 23:43:15 +01:00
fix: fixed error during item rename
This commit is contained in:
parent
6380797f92
commit
6a36313e0e
@ -331,7 +331,8 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
|
||||
return reject(new Error('Collection not found'));
|
||||
}
|
||||
|
||||
const item = findItemInCollection(collection, itemUid);
|
||||
const collectionCopy = cloneDeep(collection);
|
||||
const item = findItemInCollection(collectionCopy, itemUid);
|
||||
if(!item) {
|
||||
return reject(new Error("Unable to locate item"));
|
||||
}
|
||||
@ -356,10 +357,7 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
|
||||
return;
|
||||
}
|
||||
|
||||
const collectionCopy = cloneDeep(collection);
|
||||
if(item) {
|
||||
item.name = newName;
|
||||
}
|
||||
const collectionToSave = transformCollectionToSaveToIdb(collectionCopy, {
|
||||
ignoreDraft: true
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user