diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-20 10:49:35 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-20 10:49:35 +0700 |
| commit | d22df6bd30b8ed4bcfa938dcbbedc5fc376c2304 (patch) | |
| tree | 8d86213da671f07a57f78bd5d6ac0cce80ffe970 /src/core/utils | |
| parent | 71ca8757d549c62e7b2925793689815f4ab771ad (diff) | |
cart refactor
Diffstat (limited to 'src/core/utils')
| -rw-r--r-- | src/core/utils/cart.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/utils/cart.js b/src/core/utils/cart.js index 928d2ad1..52e157f2 100644 --- a/src/core/utils/cart.js +++ b/src/core/utils/cart.js @@ -18,7 +18,7 @@ const getItemCart = ({ productId }) => { return cart[productId] } -const addItemCart = ({ productId, quantity, selected = false }) => { +const updateItemCart = ({ productId, quantity, selected = false }) => { let cart = getCart() quantity = parseInt(quantity) cart[productId] = { productId, quantity, selected } @@ -36,6 +36,6 @@ const deleteItemCart = ({ productId }) => { export { getCart, getItemCart, - addItemCart, + updateItemCart, deleteItemCart }
\ No newline at end of file |
