bottom navbar change
This commit is contained in:
@@ -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"] });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user