summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-07 08:33:38 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-07 08:33:38 +0700
commitcb04d90c8887993f532d582e7cdb1780b86bd4be (patch)
tree0d402652f0c7b6ffc120ece27cf0dcbfeb5b3ede /src
parenteb46cfeca8da8ea2b40e5576b3789f179d5aff56 (diff)
<iman> update error code voucher tidak terbaca
Diffstat (limited to 'src')
-rw-r--r--src/lib/product/components/ProductCard.jsx4
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);