Commit bb2a774a authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	redux/globalActionType.js
#	redux/globalReducer.js
#	view/MenuSelection.js
parents aa56680d 1f2878b3
......@@ -23,6 +23,10 @@ const ActionType = {
SET_CHANGE_OUTLET:'SET_CHANGE_OUTLET',
SET_CHANGE_SHOP:'SET_CHANGE_SHOP',
ADD_TO_CHART:'ADD_TO_CHART',
<<<<<<< HEAD
=======
REMOVE_FROM_CHART:'REMOVE_FROM_CHART',
>>>>>>> 1f2878b320428b9f86712643addd48e2a9859793
}
......
......@@ -207,8 +207,13 @@ const rootReducer = (state = globalState, action) => {
}
}
case ActionType.ADD_TO_CHART:{
<<<<<<< HEAD
let addedItem = action.data.order_item
let is_exist = cart_shop.find(item => addedItem.id == item.id)
=======
let addedItem = action.data.item
let is_exist = order_item.find(item => addedItem.id == item.id)
>>>>>>> 1f2878b320428b9f86712643addd48e2a9859793
if (is_exist) {
// update
addedItem.quantity += 1
......
......@@ -184,10 +184,10 @@ const mapDispatchToProps = (dispacth) => {
id: data.cart_shop
}
}),
addToChart: (order_item) => dispacth({
addToChart: (item) => dispacth({
type: ActionType.ADD_TO_CHART,
data: {
order_item: 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