All files / app/assets/javascripts/environments/services environments_service.js

57.14% Statements 4/7
0% Branches 0/1
40% Functions 2/5
57.14% Lines 4/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28        10x 10x       10x 10x                                  
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, {});
  }
 
  // eslint-disable-next-line class-methods-use-this
  deleteAction(endpoint) {
    return axios.delete(endpoint, {});
  }
 
  getFolderContent(folderUrl, scope) {
    return axios.get(`${folderUrl}.json?per_page=${this.folderResults}&scope=${scope}`);
  }
}