This commit is contained in:
hamid zarghami
2025-09-18 13:20:16 +03:30
parent 7b51a18a4a
commit 4ed55bd1b7
13 changed files with 308 additions and 87 deletions
+18
View File
@@ -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,
});
};