summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/api.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-05-25 13:49:50 +0100
committerPhil Hughes <me@iamphill.com>2018-05-25 13:49:50 +0100
commit0c0a779f4c97622ad2359a94d1c870b75a8b0e6d (patch)
treeb87bc046f6f59d29a47a671c31c325a4fdc0c0e1 /app/assets/javascripts/api.js
parent9c464e5eae6e4eb268bbdae6ad542d1de698b623 (diff)
parent4e257213343673a71a81332e5f5703bfb3043a4f (diff)
downloadgitlab-ce-0c0a779f4c97622ad2359a94d1c870b75a8b0e6d.tar.gz
Merge branch 'master' into ide-jobs-list-components
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r--app/assets/javascripts/api.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js
index 06fdc8fe65b..dbdc4de7986 100644
--- a/app/assets/javascripts/api.js
+++ b/app/assets/javascripts/api.js
@@ -21,6 +21,7 @@ const Api = {
issuableTemplatePath: '/:namespace_path/:project_path/templates/:type/:key',
usersPath: '/api/:version/users.json',
commitPath: '/api/:version/projects/:id/repository/commits',
+ 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',
@@ -166,6 +167,19 @@ const Api = {
});
},
+ commitPipelines(projectId, sha) {
+ const encodedProjectId = projectId
+ .split('/')
+ .map(fragment => encodeURIComponent(fragment))
+ .join('/');
+
+ const url = Api.buildUrl(Api.commitPipelinesPath)
+ .replace(':project_id', encodedProjectId)
+ .replace(':sha', encodeURIComponent(sha));
+
+ return axios.get(url);
+ },
+
branchSingle(id, branch) {
const url = Api.buildUrl(Api.branchSinglePath)
.replace(':id', encodeURIComponent(id))