Welcome to mirror list, hosted at ThFree Co, Russian Federation.

environments_service.js « services « environments « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cb4ff6856db5ccb8b07eefe3826ee838b836f371 (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, nested } = options;
    return axios.get(this.environmentsEndpoint, { params: { scope, page, nested } });
  }

  // eslint-disable-next-line class-methods-use-this
  postAction(endpoint) {
    return axios.post(endpoint, {});
  }

  getFolderContent(folderUrl) {
    return axios.get(`${folderUrl}.json?per_page=${this.folderResults}`);
  }
}