fix(build): restore missing delete mutation and handler in Sidebar

This commit is contained in:
Antigravity Agent committed 2026-02-04 22:04:19 +01:00
1 parent 026ced7199
commit d80aae1bfb
1 file changed
+15 -2
+15 -2
View File
@@ -31,9 +31,22 @@ export function Sidebar({ onSelectFeed, selectedFeedId }: SidebarProps) {
},
});
// ... (deleteFeedMutation)
const deleteFeedMutation = useMutation({
mutationFn: (id: string) => feedsApi.delete(id),
onSuccess: (_, deletedId) => {
queryClient.invalidateQueries({ queryKey: ['feeds'] });
if (selectedFeedId === deletedId) {
onSelectFeed(null);
}
},
});
// ...
const handleDelete = (e: React.MouseEvent, id: string) => {
e.stopPropagation();
if (window.confirm('Voulez-vous vraiment supprimer ce flux ?')) {
deleteFeedMutation.mutate(id);
}
};
return (
<>