feat: make payment plans dynamic

This commit is contained in:
Ali BARIN
2023-03-20 21:46:20 +00:00
committed by Faruk AYDIN
parent f1358c7ad1
commit 3598d43938
4 changed files with 46 additions and 11 deletions

View File

@@ -0,0 +1,18 @@
import { useQuery } from '@apollo/client';
import { TPaymentPlan } from '@automatisch/types';
import { GET_PAYMENT_PLANS } from 'graphql/queries/get-payment-plans.ee';
type UsePaymentPlansReturn = {
plans: TPaymentPlan[];
loading: boolean;
};
export default function usePaymentPlans(): UsePaymentPlansReturn {
const { data, loading } = useQuery(GET_PAYMENT_PLANS);
return {
plans: data?.getPaymentPlans || [],
loading
};
}