diff options
author | John T Skarbek <jtslear@gmail.com> | 2019-03-05 12:44:51 -0500 |
---|---|---|
committer | John T Skarbek <jtslear@gmail.com> | 2019-03-05 12:44:51 -0500 |
commit | 3f5df8c2cd3faf0e2b583aafeed10027f182cca5 (patch) | |
tree | 06149e8b6e1df689226a179d401dfde9b68b206c /app/assets/javascripts/api.js | |
parent | ad220b8b0f8319a9574ed2c490206ade63f22d44 (diff) | |
parent | 26bff00d64d026ca99fbe348c239dc8060c00743 (diff) | |
download | gitlab-ce-3f5df8c2cd3faf0e2b583aafeed10027f182cca5.tar.gz |
Merge commit '26bff00d64d026ca99fbe348c239dc8060c00743' into 11-9-stable
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 85eb08cc97d..8754c253881 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -12,6 +12,7 @@ const Api = { projectsPath: '/api/:version/projects.json', projectPath: '/api/:version/projects/:id', projectLabelsPath: '/:namespace_path/:project_path/labels', + projectMergeRequestsPath: '/api/:version/projects/:id/merge_requests', projectMergeRequestPath: '/api/:version/projects/:id/merge_requests/:mrid', projectMergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes', projectMergeRequestVersionsPath: '/api/:version/projects/:id/merge_requests/:mrid/versions', @@ -111,6 +112,22 @@ const Api = { return axios.get(url); }, + /** + * Get all Merge Requests for a project, eventually filtering based on + * supplied parameters + * @param projectPath + * @param params + * @returns {Promise} + */ + projectMergeRequests(projectPath, params = {}) { + const url = Api.buildUrl(Api.projectMergeRequestsPath).replace( + ':id', + encodeURIComponent(projectPath), + ); + + return axios.get(url, { params }); + }, + // Return Merge Request for project projectMergeRequest(projectPath, mergeRequestId, params = {}) { const url = Api.buildUrl(Api.projectMergeRequestPath) |