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-promo/components/AddToCart.tsx | |
| parent | 55d476a4666150a013a308deb6cb99513778ac22 (diff) | |
Add qty append on upsert cart api
Diffstat (limited to 'src-migrate/modules/product-promo/components/AddToCart.tsx')
| -rw-r--r-- | src-migrate/modules/product-promo/components/AddToCart.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src-migrate/modules/product-promo/components/AddToCart.tsx b/src-migrate/modules/product-promo/components/AddToCart.tsx index 95d275fc..192dd231 100644 --- a/src-migrate/modules/product-promo/components/AddToCart.tsx +++ b/src-migrate/modules/product-promo/components/AddToCart.tsx @@ -29,7 +29,15 @@ const ProductPromoAddToCart = ({ promotion }: Props) => { if (status === 'success') return setStatus('loading') - await upsertUserCart(auth.id, 'promotion', promotion.id, 1, true) + await upsertUserCart({ + userId: auth.id, + type: 'promotion', + id: promotion.id, + qty: 1, + selected: true, + source: 'add_to_cart', + qtyAppend: true + }) setStatus('idle') toast({ |
