diff --git a/packages/twenty-front/src/modules/object-record/record-action-bar/hooks/useRecordActionBar.tsx b/packages/twenty-front/src/modules/object-record/record-action-bar/hooks/useRecordActionBar.tsx index 2e13dd4b97fa..3333ead34719 100644 --- a/packages/twenty-front/src/modules/object-record/record-action-bar/hooks/useRecordActionBar.tsx +++ b/packages/twenty-front/src/modules/object-record/record-action-bar/hooks/useRecordActionBar.tsx @@ -90,8 +90,22 @@ export const useRecordActionBar = ({ const handleDeleteClick = useCallback(async () => { callback?.(); + selectedRecordIds.forEach((recordId) => { + const foundFavorite = favorites?.find( + (favorite) => favorite.recordId === recordId, + ); + if (foundFavorite !== undefined) { + deleteFavorite(foundFavorite.id); + } + }); await deleteManyRecords(selectedRecordIds); - }, [callback, deleteManyRecords, selectedRecordIds]); + }, [ + callback, + deleteManyRecords, + selectedRecordIds, + favorites, + deleteFavorite, + ]); const handleExecuteQuickActionOnClick = useCallback(async () => { callback?.();