File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
pages/Products/ProductManager Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ export const useFetchVariants = (productId) => {
2020 unit_name : v . unitName ,
2121 unit_value : v . unitValue ,
2222 sku : v . sku ,
23- barcode : v . barcode ,
23+ barcode : v . barcode || v . pluCode || '' ,
2424 plu_code : v . pluCode ,
25- sell_price : v . sellPrice ,
26- cost_price : v . costPrice ,
27- stock_quantity : v . stockQuantity ,
28- image_url : v . imageUrl ,
29- is_active : v . isActive ,
30- created_at : v . createdAt ,
31- attributes : v . attributes ,
32- unit_conversions : v . unitConversions || [ ]
25+ sell_price : v . sellPrice || 0 ,
26+ cost_price : v . costPrice || 0 ,
27+ stock_quantity : v . stockQuantity || 0 ,
28+ image_url : v . imageUrl || v . image_url || null ,
29+ is_active : v . isActive !== false ,
30+ created_at : v . createdAt || v . created_at ,
31+ attributes : v . attributes || { } ,
32+ unit_conversions : v . unitConversions || v . unit_conversions || [ ]
3333 } ) ) ;
3434 setVariants ( mappedVariants ) ;
3535 setError ( null ) ;
Original file line number Diff line number Diff line change @@ -546,9 +546,9 @@ function ProductDetail() {
546546 < TableCell className = "font-semibold text-gray-400 text-center text-xs" > { index + 1 } </ TableCell >
547547 < TableCell className = "text-center" >
548548 < div className = "w-9 h-9 mx-auto bg-white border border-gray-200 rounded-lg flex items-center justify-center overflow-hidden" >
549- { ( variant . image_url || variant . imageUrl ) ? (
549+ { variant . image_url ? (
550550 < img
551- src = { variant . image_url || variant . imageUrl }
551+ src = { variant . image_url }
552552 alt = { variant . name }
553553 className = "w-full h-full object-cover"
554554 />
You can’t perform that action at this time.
0 commit comments