gitlab-org--gitlab-foss/app/assets/javascripts/environments/services/environments_service.js

23 lines
587 B
JavaScript
Raw Normal View History

import axios from '~/lib/utils/axios_utils';
export default class EnvironmentsService {
2017-02-09 06:38:59 -05:00
constructor(endpoint) {
this.environmentsEndpoint = endpoint;
2017-03-29 07:52:17 -04:00
this.folderResults = 3;
2016-10-14 08:14:18 -04:00
}
2016-10-26 11:00:16 -04:00
get(options = {}) {
const { scope, page } = options;
return axios.get(this.environmentsEndpoint, { params: { scope, page } });
2016-10-14 08:14:18 -04:00
}
// eslint-disable-next-line class-methods-use-this
postAction(endpoint) {
return axios.post(endpoint, {}, { emulateJSON: true });
}
2017-03-28 06:56:24 -04:00
getFolderContent(folderUrl) {
return axios.get(`${folderUrl}.json?per_page=${this.folderResults}`);
}
}