summaryrefslogtreecommitdiff
path: root/src/core/utils
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-20 10:49:35 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-20 10:49:35 +0700
commitd22df6bd30b8ed4bcfa938dcbbedc5fc376c2304 (patch)
tree8d86213da671f07a57f78bd5d6ac0cce80ffe970 /src/core/utils
parent71ca8757d549c62e7b2925793689815f4ab771ad (diff)
cart refactor
Diffstat (limited to 'src/core/utils')
-rw-r--r--src/core/utils/cart.js4
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