diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-08-07 01:35:11 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-08-07 01:35:11 +0000 |
| commit | d96c0885db3a1aa0c4c7ceb0d2ab7d64d99f67f6 (patch) | |
| tree | 0d402652f0c7b6ffc120ece27cf0dcbfeb5b3ede /src/lib | |
| parent | eb46cfeca8da8ea2b40e5576b3789f179d5aff56 (diff) | |
| parent | cb04d90c8887993f532d582e7cdb1780b86bd4be (diff) | |
Merged in bug-wishlist (pull request #215)
<iman> update error code voucher tidak terbaca
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/product/components/ProductCard.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index e10241a7..35e2a665 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -17,8 +17,8 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { const [discount, setDiscount] = useState(0); let voucherPastiHemat = 0; - - if (product?.voucherPastiHemat.length > 0) { + + if (product?.voucherPastiHemat ? product?.voucherPastiHemat.length : voucherPastiHemat > 0) { const stringVoucher = product?.voucherPastiHemat[0]; const validJsonString = stringVoucher.replace(/'/g, '"'); voucherPastiHemat = JSON.parse(validJsonString); |
