summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/api
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-14 15:09:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-14 15:09:48 +0000
commit81f257d72ef398933453d215019c850f57dae252 (patch)
treee7236ae76f96afb207d3ea85164b88c429b6f43c /app/assets/javascripts/api
parentb82c4935ecc86d1429710163287f5bd7d75bf226 (diff)
downloadgitlab-ce-81f257d72ef398933453d215019c850f57dae252.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/api')
-rw-r--r--app/assets/javascripts/api/groups_api.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/assets/javascripts/api/groups_api.js b/app/assets/javascripts/api/groups_api.js
index d4ba46656e6..d6c9e1d42cc 100644
--- a/app/assets/javascripts/api/groups_api.js
+++ b/app/assets/javascripts/api/groups_api.js
@@ -3,9 +3,9 @@ import { buildApiUrl } from './api_utils';
import { DEFAULT_PER_PAGE } from './constants';
const GROUPS_PATH = '/api/:version/groups.json';
+const DESCENDANT_GROUPS_PATH = '/api/:version/groups/:id/descendant_groups';
-export function getGroups(query, options, callback = () => {}) {
- const url = buildApiUrl(GROUPS_PATH);
+const axiosGet = (url, query, options, callback) => {
return axios
.get(url, {
params: {
@@ -19,4 +19,14 @@ export function getGroups(query, options, callback = () => {}) {
return data;
});
+};
+
+export function getGroups(query, options, callback = () => {}) {
+ const url = buildApiUrl(GROUPS_PATH);
+ return axiosGet(url, query, options, callback);
+}
+
+export function getDescendentGroups(parentGroupId, query, options, callback = () => {}) {
+ const url = buildApiUrl(DESCENDANT_GROUPS_PATH.replace(':id', parentGroupId));
+ return axiosGet(url, query, options, callback);
}