Files
ocs-portal-web/lib/price-plan/queries/index.ts
2025-04-15 13:56:54 +07:00

21 lines
634 B
TypeScript

import { useQuery } from "@tanstack/react-query"
import { pricePlanRepository } from "../data/repository"
export const usePricePlanQuery = (page: number, size: number, type: string) =>
useQuery({
queryKey: ["priceplan", page, size, type],
queryFn: () => pricePlanRepository.getPricePlan({ page, size, type }),
})
export const usePricePlanTypesQuery = () =>
useQuery({
queryKey: ["priceplanTypes"],
queryFn: () => pricePlanRepository.getPricePlanTypes(),
})
export const useServiceTypesQuery = () =>
useQuery({
queryKey: ["serviceTypes"],
queryFn: () => pricePlanRepository.getServiceTypes(),
})