diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-12 03:10:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-12 03:10:38 +0300 |
commit | e57da6ba898df025f93bf8d3a896c7c2ba2ab830 (patch) | |
tree | 0eb1feedb28db1bbf9a695aae76b025a65105404 /app/assets/javascripts/api | |
parent | 23790cda2b4145294d71591515acfe892d4c99a7 (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 | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/assets/javascripts/api/groups_api.js b/app/assets/javascripts/api/groups_api.js index f9edebb9141..e7d066efe13 100644 --- a/app/assets/javascripts/api/groups_api.js +++ b/app/assets/javascripts/api/groups_api.js @@ -9,7 +9,7 @@ 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'; -const axiosGet = (url, query, options, callback) => { +const axiosGet = (url, query, options, callback, axiosOptions = {}) => { return axios .get(url, { params: { @@ -17,6 +17,7 @@ const axiosGet = (url, query, options, callback) => { per_page: DEFAULT_PER_PAGE, ...options, }, + ...axiosOptions, }) .then(({ data, headers }) => { callback(data); @@ -25,14 +26,20 @@ const axiosGet = (url, query, options, callback) => { }); }; -export function getGroups(query, options, callback = () => {}) { +export function getGroups(query, options, callback = () => {}, axiosOptions = {}) { const url = buildApiUrl(GROUPS_PATH); - return axiosGet(url, query, options, callback); + return axiosGet(url, query, options, callback, axiosOptions); } -export function getDescendentGroups(parentGroupId, query, options, callback = () => {}) { +export function getDescendentGroups( + parentGroupId, + query, + options, + callback = () => {}, + axiosOptions = {}, +) { const url = buildApiUrl(DESCENDANT_GROUPS_PATH.replace(':id', parentGroupId)); - return axiosGet(url, query, options, callback); + return axiosGet(url, query, options, callback, axiosOptions); } export function updateGroup(groupId, data = {}) { |