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

groups_service.js « services « groups « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c31dc471022513294438f15032b613e4603fd0ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Vue from 'vue';
import VueResource from 'vue-resource';

Vue.use(VueResource);

export default class GroupsService {
  constructor(endpoint) {
    this.groups = Vue.resource(endpoint);
  }

  getGroups(parentId, page = 1) {
    const data = {};

    if (parentId) {
      data.parent_id = parentId;
    }

    if (page) {
      data.page = page;
    }

    return this.groups.get(data);
  }
}