diff options
author | Himanshu Kapoor <hkapoor@gitlab.com> | 2019-08-14 15:25:40 +0530 |
---|---|---|
committer | Himanshu Kapoor <hkapoor@gitlab.com> | 2019-08-19 14:22:46 +0530 |
commit | cf88f9dda13d15ab7f773f57c6e844691fd1a496 (patch) | |
tree | 1db4a78ead3c585799bde1df976f286e21111682 /app/assets | |
parent | f7f91e84f71afa6bcf8a22ed181ce719bfbaf35c (diff) | |
download | gitlab-ce-cf88f9dda13d15ab7f773f57c6e844691fd1a496.tar.gz |
Add new API method: projectUsersee-2502-refactor-ee-app-assets-javascripts-approvals-components-approvers_select-vue-to-remove-approverusers
The new API method projectUsers gets all the users
added to a particular project.
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/api.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index a649c521405..136ffdf8b9d 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -14,6 +14,7 @@ const Api = { projectPath: '/api/:version/projects/:id', forkedProjectsPath: '/api/:version/projects/:id/forks', projectLabelsPath: '/:namespace_path/:project_path/-/labels', + projectUsersPath: '/api/:version/projects/:id/users', projectMergeRequestsPath: '/api/:version/projects/:id/merge_requests', projectMergeRequestPath: '/api/:version/projects/:id/merge_requests/:mrid', projectMergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes', @@ -108,6 +109,20 @@ const Api = { }); }, + projectUsers(projectPath, query = '', options = {}) { + const url = Api.buildUrl(this.projectUsersPath).replace(':id', encodeURIComponent(projectPath)); + + return axios + .get(url, { + params: { + search: query, + per_page: 20, + ...options, + }, + }) + .then(({ data }) => data); + }, + // Return single project project(projectPath) { const url = Api.buildUrl(Api.projectPath).replace(':id', encodeURIComponent(projectPath)); |