diff options
Diffstat (limited to 'app/assets/javascripts/api/projects_api.js')
-rw-r--r-- | app/assets/javascripts/api/projects_api.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/api/projects_api.js b/app/assets/javascripts/api/projects_api.js index 5b5abbdf50b..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'; @@ -19,6 +21,10 @@ export function getProjects(query, options, callback = () => {}) { defaults.membership = true; } + if (gon.features.fullPathProjectSearch && query?.includes('/')) { + defaults.search_namespaces = true; + } + return axios .get(url, { params: Object.assign(defaults, options), @@ -50,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); +}; |