filter added
This commit is contained in:
@@ -16,6 +16,7 @@ export default function MainProduct() {
|
||||
const getFiltersByType = useFilter((state) => state.getFiltersByType);
|
||||
const setProduct = useProductPageInfo((state) => state.setProducts);
|
||||
|
||||
console.log("subCategory data: ", subCategory);
|
||||
// Query params yaratish
|
||||
const queryParams = useMemo(() => {
|
||||
const catalog = getFiltersByType("catalog");
|
||||
@@ -39,7 +40,7 @@ export default function MainProduct() {
|
||||
|
||||
// Query params qo'shish
|
||||
return `${baseLink}${queryParams}`;
|
||||
}, [category.id, category.have_sub_category, queryParams]);
|
||||
}, [category.id, category.have_sub_category, queryParams , subCategory.id]);
|
||||
|
||||
const { data, isLoading, error } = useQuery({
|
||||
queryKey: ["products", subCategory.id, queryParams],
|
||||
@@ -83,8 +84,8 @@ export default function MainProduct() {
|
||||
key={item.id} // ✅ index o'rniga id ishlatish
|
||||
getProduct={() => setProduct(item)}
|
||||
title={item.name}
|
||||
image={item?.images[0]?.image ||''}
|
||||
slug='special_product'
|
||||
image={item?.images[0]?.image || ""}
|
||||
slug="special_product"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user