Redirect to result when lelongId undefined in result-detail

This commit is contained in:
Amir Hassan
2023-02-22 11:50:07 +08:00
parent e863d3fd4e
commit 49c7eb8c42
+24 -20
View File
@@ -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 } });