Vue Polling - Sync code from Shipping Portal, Refactor code to use vuex

This commit is contained in:
Dillon Ngo
2024-05-20 03:05:36 +08:00
parent 56f89113a8
commit 1550ebb3cb
@@ -147,9 +147,9 @@
fetchJobResult(jobId, isLastAttempt = false) {
this.$store.dispatch('updatePollingJobResultByJobId', {'jobId': this.getJob.jobId, 'isFetchingResult': true });
try {
let anotherEndpoint = route('api.job.fetch', jobId);
let anotherEndpoint = route('api.job.fetch', this.getJob.jobId);
if(isLastAttempt){
anotherEndpoint = route('api.job.fetch.last.attempt', jobId, isLastAttempt);
anotherEndpoint = route('api.job.fetch.last.attempt', this.getJob.jobId, isLastAttempt);
}
this.poll(anotherEndpoint, 'get', this.section, false, false); //cief todo: Uncaught (in promise) null
} catch (error) {