summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r--app/assets/javascripts/api.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js
index ce1069276ab..000938e475f 100644
--- a/app/assets/javascripts/api.js
+++ b/app/assets/javascripts/api.js
@@ -11,6 +11,7 @@ const Api = {
projectPath: '/api/:version/projects/:id',
projectLabelsPath: '/:namespace_path/:project_path/labels',
mergeRequestPath: '/api/:version/projects/:id/merge_requests/:mrid',
+ mergeRequestsPath: '/api/:version/merge_requests',
mergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes',
mergeRequestVersionsPath: '/api/:version/projects/:id/merge_requests/:mrid/versions',
groupLabelsPath: '/groups/:namespace_path/-/labels',
@@ -24,8 +25,6 @@ const Api = {
commitPipelinesPath: '/:project_id/commit/:sha/pipelines',
branchSinglePath: '/api/:version/projects/:id/repository/branches/:branch',
createBranchPath: '/api/:version/projects/:id/repository/branches',
- pipelinesPath: '/api/:version/projects/:id/pipelines',
- pipelineJobsPath: '/api/:version/projects/:id/pipelines/:pipeline_id/jobs',
group(groupId, callback) {
const url = Api.buildUrl(Api.groupPath).replace(':id', groupId);
@@ -109,6 +108,12 @@ const Api = {
return axios.get(url);
},
+ mergeRequests(params = {}) {
+ const url = Api.buildUrl(Api.mergeRequestsPath);
+
+ return axios.get(url, { params });
+ },
+
mergeRequestChanges(projectPath, mergeRequestId) {
const url = Api.buildUrl(Api.mergeRequestChangesPath)
.replace(':id', encodeURIComponent(projectPath))
@@ -238,20 +243,6 @@ const Api = {
});
},
- pipelines(projectPath, params = {}) {
- const url = Api.buildUrl(this.pipelinesPath).replace(':id', encodeURIComponent(projectPath));
-
- return axios.get(url, { params });
- },
-
- pipelineJobs(projectPath, pipelineId, params = {}) {
- const url = Api.buildUrl(this.pipelineJobsPath)
- .replace(':id', encodeURIComponent(projectPath))
- .replace(':pipeline_id', pipelineId);
-
- return axios.get(url, { params });
- },
-
buildUrl(url) {
let urlRoot = '';
if (gon.relative_url_root != null) {