diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-26 15:12:12 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-26 15:12:12 +0700 |
| commit | a698514b32353d8f6386ce8ba8c20941ab65f569 (patch) | |
| tree | 0c60dc5897b5fb5936025342ae24d8b115f024ce /src-migrate/modules/product-detail/components/AddToCart.tsx | |
| parent | 55d476a4666150a013a308deb6cb99513778ac22 (diff) | |
Add qty append on upsert cart api
Diffstat (limited to 'src-migrate/modules/product-detail/components/AddToCart.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/AddToCart.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src-migrate/modules/product-detail/components/AddToCart.tsx b/src-migrate/modules/product-detail/components/AddToCart.tsx index ebd6be7a..097db98a 100644 --- a/src-migrate/modules/product-detail/components/AddToCart.tsx +++ b/src-migrate/modules/product-detail/components/AddToCart.tsx @@ -36,7 +36,15 @@ const AddToCart = ({ ) return; toast.promise( - upsertUserCart(auth.id, 'product', variantId, quantity, true, source), + upsertUserCart({ + userId: auth.id, + type: 'product', + id: variantId, + qty: quantity, + selected: true, + source: source, + qtyAppend: true + }), { loading: { title: 'Menambahkan ke keranjang', description: 'Mohon tunggu...' }, success: { title: 'Menambahkan ke keranjang', description: 'Berhasil menambahkan ke keranjang belanja' }, |
