diff --git a/src/components/common/ProductList/ProductList.tsx b/src/components/common/ProductList/ProductList.tsx
index 041ccbf94..de9cb94d5 100644
--- a/src/components/common/ProductList/ProductList.tsx
+++ b/src/components/common/ProductList/ProductList.tsx
@@ -16,7 +16,7 @@ interface ProductListProps {
const ProductList = ({ data, total = data.length, defaultCurrentPage, onPageChange }: ProductListProps) => {
const router = useRouter()
- const {wishlist } = useActiveCustomer();
+ const {wishlistId } = useActiveCustomer();
const handlePageChange = (page: number) => {
onPageChange && onPageChange(page)
@@ -35,7 +35,7 @@ const ProductList = ({ data, total = data.length, defaultCurrentPage, onPageChan
{
data.map((product, index) => {
- let activeWishlist = wishlist?.findIndex((val:string) => val == product.id) !== -1;
+ let activeWishlist = wishlistId?.findIndex((val:string) => val == product.id) !== -1;
return
})
}
diff --git a/src/components/hooks/auth/useActiveCustomer.tsx b/src/components/hooks/auth/useActiveCustomer.tsx
index 67aa798cf..a3d8ce34a 100644
--- a/src/components/hooks/auth/useActiveCustomer.tsx
+++ b/src/components/hooks/auth/useActiveCustomer.tsx
@@ -15,7 +15,8 @@ const useActiveCustomer = () => {
phoneNumber: data?.activeCustomer?.phoneNumber,
address: data?.activeCustomer?.addresses?.[0]
},
- wishlist: data?.activeCustomer?.favorites?.items.map((val:Favorite)=>val.product.id),
+ itemWishlist:data?.activeCustomer?.favorites?.items,
+ wishlistId: data?.activeCustomer?.favorites?.items.map((val:Favorite)=>val.product.id),
...rest
}
}