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

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

# Conflicts:
#	view/ShoppingCart.js
parents 89ea7675 4e013512
...@@ -123,19 +123,22 @@ class ShoppingCart extends React.Component { ...@@ -123,19 +123,22 @@ class ShoppingCart extends React.Component {
price: item.price, price: item.price,
} }
this.props.reduceQuantityItem(order_item)
let quantity = 0 if (is_xist.quantity == 1) {
for (let i = 0; i < list_order_item.length; i++) { Alert.alert(
const row = list_order_item[i]; "Delete item",
if (row.id == item.id) { "Are you sure want to delete item?",
quantity = row.quantity [
} {
text: 'Cancel',
} onPress: () => console.log('Cancel Delete Item'),
style: 'cancel',
},
{
text: 'Delete Item', onPress: () => {
this.props.reduceQuantityItem(order_item)
if (quantity == 0) { if (is_xist.quantity == 0) {
Alert.alert("Apakah anda ingin menghapus pesanan?");
const order_item = { const order_item = {
id: item.id, id: item.id,
name: item.name, name: item.name,
...@@ -150,8 +153,20 @@ class ShoppingCart extends React.Component { ...@@ -150,8 +153,20 @@ class ShoppingCart extends React.Component {
this.props.removeFromChart(order_item) this.props.removeFromChart(order_item)
} }
} }
},
],
{ cancelable: false },
)
} else {
this.props.reduceQuantityItem(order_item)
}
} }
} }
}
deleteItem() {
}
handleAdd(item, index) { handleAdd(item, index) {
......
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