Redirect to result when lelongId undefined in result-detail
This commit is contained in:
@@ -590,27 +590,31 @@ export default {
|
||||
},
|
||||
liveData() {
|
||||
this.loading = true;
|
||||
axios
|
||||
.get("/bayar/" + localStorage.getItem("id") + "/" + this.lelongId, {
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// console.log("liveData", response);
|
||||
if (response.data.success == true) {
|
||||
this.isSuccess = true;
|
||||
if(this.lelongId != null) {
|
||||
axios
|
||||
.get("/bayar/" + localStorage.getItem("id") + "/" + this.lelongId, {
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// console.log("liveData", response);
|
||||
if (response.data.success == true) {
|
||||
this.isSuccess = true;
|
||||
this.loading = false;
|
||||
this.lists = response.data.data;
|
||||
this.tarikhLelong = response.data.tarikh_lelong;
|
||||
} else {
|
||||
this.isSuccess = false;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false;
|
||||
this.lists = response.data.data;
|
||||
this.tarikhLelong = response.data.tarikh_lelong;
|
||||
} else {
|
||||
this.isSuccess = false;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false;
|
||||
console.log(error);
|
||||
});
|
||||
console.log(error);
|
||||
});
|
||||
} else {
|
||||
this.$router.push({ name: "result" });
|
||||
}
|
||||
},
|
||||
clickPayButton(value) {
|
||||
this.$router.push({ name: "pay", params: { lelongId: value } });
|
||||
|
||||
Reference in New Issue
Block a user