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

utils.js « entity_select « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0a4622269f45de986459648470173c28702bfbc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Api from '~/api';

export const groupsPath = (groupsFilter, parentGroupID) => {
  if (groupsFilter !== undefined && parentGroupID === undefined) {
    throw new Error('Cannot use groupsFilter without a parentGroupID');
  }
  switch (groupsFilter) {
    case 'descendant_groups':
      return Api.descendantGroupsPath.replace(':id', parentGroupID);
    case 'subgroups':
      return Api.subgroupsPath.replace(':id', parentGroupID);
    default:
      return Api.groupsPath;
  }
};