Feat/parapharmacy api #38
@@ -39,7 +39,7 @@ function ProductResults({ products, onSelect }) {
|
||||
<div className="product-results">
|
||||
{products.map((product) => (
|
||||
<ProductCard
|
||||
key={product.id}
|
||||
key={product._id || product.id}
|
||||
product={product}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
|
||||
@@ -322,10 +322,11 @@ function SearchView({ currentUser, onLoginRequest, initialQuery = '', onNavigate
|
||||
<ProductResults
|
||||
products={products}
|
||||
onSelect={(p) => {
|
||||
const productId = p._id || p.id;
|
||||
if (onNavigateToProduct) {
|
||||
onNavigateToProduct(p.source, p.id);
|
||||
onNavigateToProduct(p.source, productId);
|
||||
} else {
|
||||
window.location.href = `/product/${p.source}/${p.id}`;
|
||||
window.location.href = `/product/${p.source}/${productId}`;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user