responsive danak-services
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/ProductService";
|
||||
|
||||
export const useGetServicesByCategory = (categoryId?: string) =>
|
||||
useQuery({
|
||||
queryKey: ["services", categoryId],
|
||||
queryFn: () => api.getServicesByCategory(categoryId),
|
||||
});
|
||||
|
||||
export const servicesQueryOptions = {
|
||||
queryKey: ["services", ""],
|
||||
queryFn: () => api.getServicesByCategory(undefined),
|
||||
};
|
||||
|
||||
export const useGetCategories = () =>
|
||||
useQuery({
|
||||
queryKey: ["service-categories"],
|
||||
queryFn: () => api.getCategoriesPublic(),
|
||||
});
|
||||
|
||||
export const categoriesQueryOptions = {
|
||||
queryKey: ["service-categories"],
|
||||
queryFn: () => api.getCategoriesPublic(),
|
||||
};
|
||||
Reference in New Issue
Block a user