fixed bank details not showing bug

This commit is contained in:
omair saleh
2020-09-15 13:05:19 +08:00
parent 96a0a72390
commit 86edd907f4
@@ -264,46 +264,47 @@
name: 'home'
})
}
}).catch((error) => {
}).then(() => {
axios.get('/api/active-bank')
.then((response) => {
this.active_bank_setting = response.data;
var url = '';
if (this.booking.term === 'x1_cash' || this.booking.term === 'x1_cheque' || this.booking.term === 'x1_ba') {
url = '/api/malaysia-bank/' + this.active_bank_setting.x1_bank_id;
} else if (this.booking.term === 'x2_cash' || this.booking.term === 'x2_cheque' || this.booking.term === 'x2_ba') {
url = '/api/malaysia-bank/' + this.active_bank_setting.x2_bank_id;
}
axios.get(url)
.then((response) => {
this.bankDetail = response.data;
loading.close()
})
.catch((error) => {
loading.close()
console.log(error);
this.$message({
showClose: true,
message: 'Fetch data fail',
type: 'error',
duration: 10000
});
});
})
.catch((error) => {
console.log(error);
this.$message({
showClose: true,
message: 'Fetch bank details fail',
type: 'error',
duration: 10000
});
});
}).catch((error) => {
this.$router.push({
name: 'notfound'
})
console.log(error)
})
axios.get('/api/active-bank')
.then((response) => {
this.active_bank_setting = response.data;
var url = '';
if (this.booking.term === 'x1_cash' || this.booking.term === 'x1_cheque' || this.booking.term === 'x1_ba') {
url = '/api/malaysia-bank/' + this.active_bank_setting.x1_bank_id;
} else if (this.booking.term === 'x2_cash' || this.booking.term === 'x2_cheque' || this.booking.term === 'x2_ba') {
url = '/api/malaysia-bank/' + this.active_bank_setting.x2_bank_id;
}
axios.get(url)
.then((response) => {
this.bankDetail = response.data;
loading.close()
})
.catch((error) => {
loading.close()
console.log(error);
this.$message({
showClose: true,
message: 'Fetch data fail',
type: 'error',
duration: 10000
});
});
})
.catch((error) => {
console.log(error);
this.$message({
showClose: true,
message: 'Fetch bank details fail',
type: 'error',
duration: 10000
});
});
},
methods: {