debian-mirror-gitlab/app/assets/javascripts/environments/services/environments_service.js

26 lines
604 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
/* eslint-disable class-methods-use-this */
import Vue from 'vue';
import VueResource from 'vue-resource';
Vue.use(VueResource);
export default class EnvironmentsService {
constructor(endpoint) {
this.environments = Vue.resource(endpoint);
this.folderResults = 3;
}
2017-09-10 17:25:29 +05:30
get(options = {}) {
const { scope, page } = options;
2017-08-17 22:00:37 +05:30
return this.environments.get({ scope, page });
}
postAction(endpoint) {
return Vue.http.post(endpoint, {}, { emulateJSON: true });
}
getFolderContent(folderUrl) {
return Vue.http.get(`${folderUrl}.json?per_page=${this.folderResults}`);
}
}