diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-18 10:17:16 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-18 10:17:16 +0700 |
| commit | 62efd1afc02422545579c529cd954d0c157889ee (patch) | |
| tree | 09fa6a45b1b0f31af4e019ac6c4437721774e1cf /src/lib/product/components/Product.jsx | |
| parent | ff9e6c43f451ed933b0cb8d35623bf3b6a1de1c4 (diff) | |
navbar user dropdown, add to cart
Diffstat (limited to 'src/lib/product/components/Product.jsx')
| -rw-r--r-- | src/lib/product/components/Product.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/product/components/Product.jsx b/src/lib/product/components/Product.jsx index d1586ef9..9b41f5c3 100644 --- a/src/lib/product/components/Product.jsx +++ b/src/lib/product/components/Product.jsx @@ -18,10 +18,10 @@ const Product = ({ product }) => { } const data = { product_id: product.id } await createOrDeleteWishlistApi({ data }) - if (wishlist.data.productTotal > 0) { + if (wishlist?.data?.productTotal > 0) { toast.success('Berhasil menghapus dari wishlist') } else { - toast.success('Berhasil menambahkan ke wishlist') + toast.error('Terjadi kesalahan internal, gagal menambahkan ke wishlist') } wishlist.refetch() } |
