mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-11 17:28:05 +02:00
fix(build): restore missing delete mutation and handler in Sidebar
This commit is contained in:
1 parent
026ced7199
commit
d80aae1bfb
1 file changed
+15
-2
@@ -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 (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user