Skip to content
Snippets Groups Projects
Commit 2caf62d1 authored by Regis Boudinot's avatar Regis Boudinot :rocket:
Browse files

refactor

parent 5ed18942
No related branches found
No related tags found
2 merge requests!7857WIP: Realtime pipeline index vue,!7196Pipelines Vue
Pipeline #
......@@ -2,38 +2,30 @@
/* eslint-disable no-param-reassign */
((gl) => {
const goFetch = (that, vue) =>
that.$http.get(`/api/v3/projects/${that.scope}/pipelines`)
.then((response) => {
vue.set(that, 'pipelines', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
});
gl.PipelineStore = class {
fetchDataLoop(Vue) {
const goFetch = vue =>
this.$http.get(`/api/v3/projects/${this.scope}/pipelines`)
.then((response) => {
vue.set(this, 'pipelines', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
});
setInterval(() => {
console.log('DID IT');
goFetch(Vue);
goFetch(this, Vue);
}, 30000);
}
fetchCommits(vue) {
const goFetch = vueSet =>
this.$http.get(`/api/v3/projects/${this.scope}/pipelines`)
.then((response) => {
vueSet.set(this, 'pipelines', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
});
this.$http.get(`/api/v3/projects/${this.scope}/repository/commits`)
.then((response) => {
vue.set(this, 'commits', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
})
.then(() => goFetch(vue));
.then(() => goFetch(this, vue));
}
};
})(window.gl || (window.gl = {}));
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