21 lines
634 B
TypeScript
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(),
|
|
})
|