banner
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/Service";
|
||||
|
||||
export const useGetCompare = (productIds: string[]) => {
|
||||
return useQuery({
|
||||
queryKey: ["compare", productIds],
|
||||
queryFn: () => api.getCompare(productIds),
|
||||
enabled: !!productIds,
|
||||
});
|
||||
};
|
||||
|
||||
export const useSearchCompareProduct = (productId?: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["compare", productId],
|
||||
queryFn: () => api.searchComparProduct(productId),
|
||||
enabled: !!productId,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user