fix: use _id for MongoDB products in frontend
- SearchView now uses p._id || p.id for product navigation - ProductResults uses product._id || product.id for React key - Fixes 'undefined' error when clicking parapharmacy products
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user