Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong proptypes #924

Merged
merged 2 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ RecommendedProducts.propTypes = {
/* The recommender to request */
recommender: PropTypes.string,

/* The product IDs to use for recommendation context */
products: PropTypes.arrayOf(PropTypes.string),
/* The products to use for recommendation context */
products: PropTypes.arrayOf(PropTypes.object),

/* Callback to determine if the component should fetch results */
shouldFetch: PropTypes.func
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const AddToCartModal = () => {
/>
}
recommender={'pdp-similar-items'}
products={product}
products={[product]}
mx={{base: -4, md: -8, lg: 0}}
shouldFetch={() => product?.id}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const Cart = () => {
/>
}
recommender={'product-to-product-einstein'}
products={basket?.productItems?.map((item) => item.productId)}
products={basket?.productItems?.map((item) => item)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not just the same as products={basket?.productItems}

shouldFetch={() =>
basket?.basketId && basket.productItems?.length > 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const ProductDetail = ({category, product, isLoading}) => {
/>
}
recommender={'complete-the-set'}
products={product}
products={[product]}
mx={{base: -4, md: -8, lg: 0}}
shouldFetch={() => product?.id}
/>
Expand All @@ -278,7 +278,7 @@ const ProductDetail = ({category, product, isLoading}) => {
/>
}
recommender={'pdp-similar-items'}
products={product}
products={[product]}
mx={{base: -4, md: -8, lg: 0}}
shouldFetch={() => product?.id}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ ProductList.propTypes = {
searchQuery: PropTypes.string,
onAddToWishlistClick: PropTypes.func,
onRemoveWishlistClick: PropTypes.func,
category: PropTypes.string
category: PropTypes.object
}

export default ProductList
Expand Down