diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-07 08:33:38 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-07 08:33:38 +0700 |
| commit | cb04d90c8887993f532d582e7cdb1780b86bd4be (patch) | |
| tree | 0d402652f0c7b6ffc120ece27cf0dcbfeb5b3ede /src/lib/product | |
| parent | eb46cfeca8da8ea2b40e5576b3789f179d5aff56 (diff) | |
<iman> update error code voucher tidak terbaca
Diffstat (limited to 'src/lib/product')
| -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); |
