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