This commit is contained in:
hamid zarghami
2025-05-06 12:32:06 +03:30
parent 817327519a
commit 3b409a3c56
6 changed files with 104 additions and 52 deletions
+19 -1
View File
@@ -1,5 +1,10 @@
import { useQuery, useMutation } from "@tanstack/react-query";
import { getSupportPlans, buySupportPlan } from "../service/SupportService";
import {
getSupportPlans,
buySupportPlan,
getUserSupportPlan,
upgradeSupportPlan,
} from "../service/SupportService";
export const useGetSupportPlans = () => {
return useQuery({ queryKey: ["support-plans"], queryFn: getSupportPlans });
@@ -10,3 +15,16 @@ export const useBuySupportPlan = () => {
mutationFn: (planId: string) => buySupportPlan(planId),
});
};
export const useGetUserSupportPlan = () => {
return useQuery({
queryKey: ["user-support-plan"],
queryFn: getUserSupportPlan,
});
};
export const useUpgradeSupportPlan = () => {
return useMutation({
mutationFn: (id: string) => upgradeSupportPlan(id),
});
};