Merge pull request #5975 from abhishek-bruno/fix/reorder-item-when-deleting-v2

Refactor: Enhance Request Item sequencing
This commit is contained in:
Bijin A B
2025-11-17 16:19:00 +05:30
committed by GitHub
4 changed files with 123 additions and 4 deletions

View File

@@ -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();
};