import * as api from "../service/NotificationService"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; export const useGetNotifications = () => { return useQuery({ queryKey: ["notifications"], queryFn: api.getNotifications, }); }; export const useDeleteNotification = () => { const queryClient = useQueryClient(); return useMutation({ mutationFn: api.deleteNotification, onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["notifications"] }); }, }); };