mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 22:45:25 +00:00
Merge pull request #5975 from abhishek-bruno/fix/reorder-item-when-deleting-v2
Refactor: Enhance Request Item sequencing
This commit is contained in:
@@ -6,13 +6,13 @@ import { closeTabs } from 'providers/ReduxStore/slices/tabs';
|
||||
import { deleteItem } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import { recursivelyGetAllItemUids } from 'utils/collections';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
import toast from 'react-hot-toast';
|
||||
|
||||
const DeleteCollectionItem = ({ onClose, item, collectionUid }) => {
|
||||
const dispatch = useDispatch();
|
||||
const isFolder = isItemAFolder(item);
|
||||
const onConfirm = () => {
|
||||
dispatch(deleteItem(item.uid, collectionUid)).then(() => {
|
||||
|
||||
if (isFolder) {
|
||||
// close all tabs that belong to the folder
|
||||
// including the folder itself and its children
|
||||
@@ -30,6 +30,9 @@ const DeleteCollectionItem = ({ onClose, item, collectionUid }) => {
|
||||
})
|
||||
);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('Error deleting item', error);
|
||||
toast.error(error?.message || 'Error deleting item');
|
||||
});
|
||||
onClose();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user