diff --git a/src/components/pay/ThePay.vue b/src/components/pay/ThePay.vue index a858ac2..84783df 100644 --- a/src/components/pay/ThePay.vue +++ b/src/components/pay/ThePay.vue @@ -121,33 +121,37 @@ export default { methods: { liveData() { this.isLoading = true; - axios - .get( - "/bayarBaki/" + - localStorage.getItem("id") + - // "/1" , - "/" + - this.lelongId, - { - headers: { - Authorization: "Bearer " + localStorage.getItem("token"), - }, - } - ) - .then((response) => { - // console.log("liveData", response); - this.isLoading = false; - if (response.data.success == true) { - this.isSuccess = true; - this.lists = response.data.data; - this.tarikhLelong = response.data.tarikh_lelong; - } else { - } - }) - .catch((error) => { - this.isLoading = false; - console.log(error); - }); + if(this.lelongId != null){ + axios + .get( + "/bayarBaki/" + + localStorage.getItem("id") + + // "/1" , + "/" + + this.lelongId, + { + headers: { + Authorization: "Bearer " + localStorage.getItem("token"), + }, + } + ) + .then((response) => { + // console.log("liveData", response); + this.isLoading = false; + if (response.data.success == true) { + this.isSuccess = true; + this.lists = response.data.data; + this.tarikhLelong = response.data.tarikh_lelong; + } else { + } + }) + .catch((error) => { + this.isLoading = false; + console.log(error); + }); + } else { + this.$router.push({ name: "result" }); + } }, clickCancelButton() { this.$router.push({