diff options
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 185cdaa1c99..6dfc1c609de 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -33,6 +33,7 @@ const Api = { forkedProjectsPath: '/api/:version/projects/:id/forks', projectLabelsPath: '/:namespace_path/:project_path/-/labels', projectFileSchemaPath: '/:namespace_path/:project_path/-/schema/:ref/:filename', + projectGroupsPath: '/api/:version/projects/:id/groups.json', projectUsersPath: '/api/:version/projects/:id/users', projectInvitationsPath: '/api/:version/projects/:id/invitations', projectMembersPath: '/api/:version/projects/:id/members', @@ -177,6 +178,19 @@ const Api = { }); }, + projectGroups(id, options) { + const url = Api.buildUrl(this.projectGroupsPath).replace(':id', encodeURIComponent(id)); + + return axios + .get(url, { + params: { + ...options, + }, + }) + .then(({ data }) => { + return data; + }); + }, /** * @deprecated This method will be removed soon. Use the * `getGroups` method in `~/rest_api` instead. |