blob: 3b121551aca66929a3240f7a1af8355b4ae76932 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import axios from '~/lib/utils/axios_utils';
export default class EnvironmentsService {
constructor(endpoint) {
this.environmentsEndpoint = endpoint;
this.folderResults = 3;
}
fetchEnvironments(options = {}) {
const { scope, page } = options;
return axios.get(this.environmentsEndpoint, { params: { scope, page } });
}
// eslint-disable-next-line class-methods-use-this
postAction(endpoint) {
return axios.post(endpoint, {}, { emulateJSON: true });
}
getFolderContent(folderUrl) {
return axios.get(`${folderUrl}.json?per_page=${this.folderResults}`);
}
}
|