buy service and discount and text + ...
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/ServiceService";
|
||||
import { BuyServiceType } from "../types/ServiecTypes";
|
||||
|
||||
export const useGetSuggestedServices = () => {
|
||||
return useQuery({
|
||||
@@ -30,3 +31,16 @@ export const useGetDetailService = (serviceId: string) => {
|
||||
enabled: !!serviceId,
|
||||
});
|
||||
};
|
||||
|
||||
export const useBuyService = () => {
|
||||
return useMutation({
|
||||
mutationFn: (variables: BuyServiceType) => api.buyService(variables),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetMyServices = (search: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["myservices", search],
|
||||
queryFn: () => api.getMyServices(search),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user