Commit c12d0dd3 authored by Trisno's avatar Trisno

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

# Conflicts:
#	view/MenuConfirmation.js
#	view/OrderDetail.js
parents fe11b661 c039fa8e
......@@ -67,7 +67,7 @@ export default function App() {
} else if (data.action_type == 'Inbox') {
} else if (data.action_type == 'Transaction') {
RootNavigation.navigate('Transaction Detail', {idTrans:data.data_id});
RootNavigation.navigate('Order Detail', {idTrans:data.data_id});
} else if (data.action_type == 'Review') {
RootNavigation.navigate('RatingOrder', {idTrans:data.data_id});
} else if (data.action_type == 'WebView') {
......
......@@ -115,14 +115,8 @@ class MenuConfirmation extends React.Component {
{ cancelable: false }
);
}).catch(error => {
console.log(error.response)
if (error.response.status <= 500) {
let response = error.response.data;
Alert.alert('', response.msg);
} else {
let response = error.response.data;
Alert.alert('', response.msg);
}
this.setState({
spinner: false,
})
......@@ -190,12 +184,13 @@ class MenuConfirmation extends React.Component {
{ cancelable: false }
);
}).catch(error => {
if (error.response.status <= 500) {
Alert.alert(String(error.response.status), 'Internal Server Error')
} else {
let response = error.response.data;
Alert.alert('', response.msg);
}
this.setState({
spinner: false,
})
this.setState({
spinner: false,
})
......
......@@ -51,9 +51,24 @@ class OrderDetail extends React.Component {
}
handleCancel() {
this.setState({
modalVisible: true
})
// this.setState({
// modalVisible: true
// })
Alert.alert(
"Cancel Order",
"Are you sure you want to cancel the order ?",
[
{
text: 'No',
onPress: () => console.log('Cancel Delete Item'),
style: 'cancel',
},
{
text: 'Yes', onPress: () => this.handleOrderCancel()
},
],
{ cancelable: false },
)
}
handleBack() {
......@@ -63,13 +78,11 @@ class OrderDetail extends React.Component {
}
handleOrderCancel() {
if (this.state.reason == '') {
Alert.alert('', 'Reason must be filled !')
} else {
let params = {
session_id: this.props.session_id,
transaction_id: this.props.route.params.idTrans,
reason: this.state.reason
reason: "Cancelled By User"
}
// console.log(params)
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/cancel', params).then(res => {
......@@ -83,7 +96,6 @@ class OrderDetail extends React.Component {
this.setState({
modalVisible: false
})
}
}
......@@ -254,7 +266,6 @@ class OrderDetail extends React.Component {
)
}
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey', top: 10 }}>Keterangan : {item.item_note} </Text> */}
</View>
<View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.item_quantity * item.item_price} </Text> */}
......
......@@ -168,12 +168,12 @@ class ShoppingCart extends React.Component {
"Are you sure want to delete item?",
[
{
text: 'Cancel',
text: 'No',
onPress: () => console.log('Cancel Delete Item'),
style: 'cancel',
},
{
text: 'Delete Item', onPress: () => {
text: 'Yes', onPress: () => {
this.props.reduceQuantityItem(order_item)
if (is_xist.quantity == 0) {
......
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