remove commit endpoint callprep for backend api to be updated or new endpoint to be built

This commit is contained in:
Regis 2016-10-31 15:06:25 -06:00
parent a42140d08f
commit 87d4d23568
2 changed files with 13 additions and 25 deletions

View file

@ -9,7 +9,6 @@
data() {
return {
pipelines: [],
commits: [],
currentPage: '',
intervalId: '',
};
@ -19,7 +18,6 @@
'store',
],
created() {
this.store.fetchCommits.call(this, Vue);
this.store.fetchDataLoop.call(this, Vue);
},
methods: {

View file

@ -4,35 +4,25 @@
((gl) => {
const api = '/api/v3/projects';
const goFetch = (that, vue) =>
that.$http.get(
`${api}/${that.scope}/pipelines?per_page=5&page=1`
gl.PipelineStore = class {
fetchDataLoop(Vue) {
const goFetch = () =>
this.$http.get(
`${api}/${this.scope}/pipelines?per_page=5&page=1`
)
.then((response) => {
vue.set(that, 'pipelines', JSON.parse(response.body));
Vue.set(this, 'pipelines', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
});
gl.PipelineStore = class {
fetchDataLoop(Vue) {
goFetch();
// eventually clearInterval(this.intervalId)
this.intervalId = setInterval(() => {
console.log('DID IT');
goFetch(this, Vue);
goFetch();
}, 30000);
}
fetchCommits(vue) {
this.$http.get(
`${api}/${this.scope}/repository/commits?per_page=5&page=1`
)
.then((response) => {
vue.set(this, 'commits', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
})
.then(() => goFetch(this, vue));
}
};
})(window.gl || (window.gl = {}));