Commit 1f2878b3 authored by Afid's avatar Afid

aaaaaaa

parent 882f594f
...@@ -207,8 +207,8 @@ const rootReducer = (state = globalState, action) => { ...@@ -207,8 +207,8 @@ const rootReducer = (state = globalState, action) => {
} }
} }
case ActionType.ADD_TO_CHART:{ case ActionType.ADD_TO_CHART:{
let addedItem = action.data.order_item let addedItem = action.data.item
let is_exist = cart_shop.find(item => addedItem.id == item.id) let is_exist = order_item.find(item => addedItem.id == item.id)
if (is_exist) { if (is_exist) {
// update // update
addedItem.quantity += 1 addedItem.quantity += 1
......
...@@ -184,10 +184,10 @@ const mapDispatchToProps = (dispacth) => { ...@@ -184,10 +184,10 @@ const mapDispatchToProps = (dispacth) => {
id: data.cart_shop id: data.cart_shop
} }
}), }),
addToChart: (order_item) => dispacth({ addToChart: (item) => dispacth({
type: ActionType.ADD_TO_CHART, type: ActionType.ADD_TO_CHART,
data: { data: {
order_item: params.order_item item: item
} }
}), }),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment