bottom navbar change

This commit is contained in:
hamid zarghami
2025-12-15 10:55:38 +03:30
parent f5368617b6
commit 31ff595f24
5 changed files with 169 additions and 37 deletions
@@ -1,5 +1,5 @@
import * as api from "../service/NotificationService";
import { useQuery } from "@tanstack/react-query";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
export const useGetNotifications = () => {
return useQuery({
@@ -7,3 +7,13 @@ export const useGetNotifications = () => {
queryFn: api.getNotifications,
});
};
export const useDeleteNotification = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: api.deleteNotification,
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["notifications"] });
},
});
};