diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 21:08:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 21:08:55 +0300 |
commit | 8f9307985ea047abb5b8a7c6c56bb644e0b7c363 (patch) | |
tree | 474c91c280b903c345bd94f4842abf481c535656 /app/assets/javascripts/api | |
parent | 3cda3d43aef1e92e2eedf7383122c6db9c61149f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/api')
-rw-r--r-- | app/assets/javascripts/api/groups_api.js | 9 | ||||
-rw-r--r-- | app/assets/javascripts/api/projects_api.js | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/api/groups_api.js b/app/assets/javascripts/api/groups_api.js index e859160c2e7..1b216e6f721 100644 --- a/app/assets/javascripts/api/groups_api.js +++ b/app/assets/javascripts/api/groups_api.js @@ -4,6 +4,8 @@ import { buildApiUrl } from './api_utils'; const GROUP_PATH = '/api/:version/groups/:id'; const GROUPS_PATH = '/api/:version/groups.json'; +const GROUP_MEMBERS_PATH = '/api/:version/groups/:id/members'; +const GROUP_ALL_MEMBERS_PATH = '/api/:version/groups/:id/members/all'; const DESCENDANT_GROUPS_PATH = '/api/:version/groups/:id/descendant_groups'; const GROUP_TRANSFER_LOCATIONS_PATH = 'api/:version/groups/:id/transfer_locations'; @@ -45,3 +47,10 @@ export const getGroupTransferLocations = (groupId, params = {}) => { return axios.get(url, { params: { ...defaultParams, ...params } }); }; + +export const getGroupMembers = (groupId, inherited = false) => { + const path = inherited ? GROUP_ALL_MEMBERS_PATH : GROUP_MEMBERS_PATH; + const url = buildApiUrl(path).replace(':id', groupId); + + return axios.get(url); +}; diff --git a/app/assets/javascripts/api/projects_api.js b/app/assets/javascripts/api/projects_api.js index fe2e2bde940..5c0d101ef5b 100644 --- a/app/assets/javascripts/api/projects_api.js +++ b/app/assets/javascripts/api/projects_api.js @@ -3,6 +3,8 @@ import axios from '../lib/utils/axios_utils'; import { buildApiUrl } from './api_utils'; const PROJECTS_PATH = '/api/:version/projects.json'; +const PROJECT_MEMBERS_PATH = '/api/:version/projects/:id/members'; +const PROJECT_ALL_MEMBERS_PATH = '/api/:version/projects/:id/members/all'; const PROJECT_IMPORT_MEMBERS_PATH = '/api/:version/projects/:id/import_project_members/:project_id'; const PROJECT_REPOSITORY_SIZE_PATH = '/api/:version/projects/:id/repository_size'; const PROJECT_TRANSFER_LOCATIONS_PATH = 'api/:version/projects/:id/transfer_locations'; @@ -54,3 +56,10 @@ export const getTransferLocations = (projectId, params = {}) => { return axios.get(url, { params: { ...defaultParams, ...params } }); }; + +export const getProjectMembers = (projectId, inherited = false) => { + const path = inherited ? PROJECT_ALL_MEMBERS_PATH : PROJECT_MEMBERS_PATH; + const url = buildApiUrl(path).replace(':id', projectId); + + return axios.get(url); +}; |