diff options
author | Phil Hughes <me@iamphill.com> | 2019-06-19 11:21:48 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-06-19 11:21:48 +0100 |
commit | 778c705ffd99df0877159c10c39f0ab6964a52a7 (patch) | |
tree | c11f89870db485e6cd619036b2114ecc58e9f862 /app/assets/javascripts/api.js | |
parent | 8716eb0cef94dbbaab5821aa693a9d92fa9f37e8 (diff) | |
download | gitlab-ce-778c705ffd99df0877159c10c39f0ab6964a52a7.tar.gz |
Added forked projects API call function
Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/58583
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 7cebb88f3a4..4f66a5d080c 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -12,6 +12,7 @@ const Api = { groupProjectsPath: '/api/:version/groups/:id/projects.json', projectsPath: '/api/:version/projects.json', projectPath: '/api/:version/projects/:id', + forkedProjectsPath: '/api/:version/projects/:id/forks', projectLabelsPath: '/:namespace_path/:project_path/-/labels', projectMergeRequestsPath: '/api/:version/projects/:id/merge_requests', projectMergeRequestPath: '/api/:version/projects/:id/merge_requests/:mrid', @@ -114,6 +115,21 @@ const Api = { }, /** + * Get all projects for a forked relationship to a specified project + * @param {string} projectPath - Path or ID of a project + * @param {Object} params - Get request parameters + * @returns {Promise} - Request promise + */ + projectForks(projectPath, params) { + const url = Api.buildUrl(Api.forkedProjectsPath).replace( + ':id', + encodeURIComponent(projectPath), + ); + + return axios.get(url, { params }); + }, + + /** * Get all Merge Requests for a project, eventually filtering based on * supplied parameters * @param projectPath |