Skip to content
Snippets Groups Projects
Commit 0bc8440d authored by Filipa Lacerda's avatar Filipa Lacerda
Browse files

Stop polling and fetch the table

parent 6c76e81b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -65,13 +65,13 @@ export default {
updateTable() {
// Cancel ongoing request
if (this.isMakingRequest) {
this.service.cancelationSource.cancel();
}
 
// Stop polling
this.poll.stop();
// make new request
this.fetchPipelines();
this.getPipelines();
// restart polling
this.poll.restart();
},
Loading
Loading
@@ -79,11 +79,14 @@ export default {
if (!this.isMakingRequest) {
this.isLoading = true;
 
this.service.getPipelines(this.requestData)
.then(response => this.successCallback(response))
.catch(() => this.errorCallback());
this.getPipelines();
}
},
getPipelines() {
this.service.getPipelines(this.requestData)
.then(response => this.successCallback(response))
.catch(() => this.errorCallback());
},
setCommonData(pipelines) {
this.store.storePipelines(pipelines);
this.isLoading = false;
Loading
Loading
Loading
Loading
@@ -19,8 +19,13 @@ export default class PipelinesService {
 
getPipelines(data = {}) {
const { scope, page } = data;
const CancelToken = axios.CancelToken;
this.cancelationSource = CancelToken.source();
return axios.get(this.endpoint, {
params: { scope, page },
cancelToken: this.cancelationSource.token,
});
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment