mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-25 17:33:28 +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'));
|
return reject(new Error('Collection not found'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const item = findItemInCollection(collection, itemUid);
|
const collectionCopy = cloneDeep(collection);
|
||||||
|
const item = findItemInCollection(collectionCopy, itemUid);
|
||||||
if(!item) {
|
if(!item) {
|
||||||
return reject(new Error("Unable to locate item"));
|
return reject(new Error("Unable to locate item"));
|
||||||
}
|
}
|
||||||
@ -356,10 +357,7 @@ export const renameItem = (newName, itemUid, collectionUid) => (dispatch, getSta
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const collectionCopy = cloneDeep(collection);
|
|
||||||
if(item) {
|
|
||||||
item.name = newName;
|
item.name = newName;
|
||||||
}
|
|
||||||
const collectionToSave = transformCollectionToSaveToIdb(collectionCopy, {
|
const collectionToSave = transformCollectionToSaveToIdb(collectionCopy, {
|
||||||
ignoreDraft: true
|
ignoreDraft: true
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user