diff options
author | André Luís <me@andr3.net> | 2018-05-25 10:08:53 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-25 10:08:53 +0000 |
commit | c53890548e15c15b38f3aa7911a69a4c24173f15 (patch) | |
tree | c1452bf14ae2ef959fc461b6138e5ad7651f6337 /app/assets/javascripts/api.js | |
parent | de12348ee8534b2a4310c81898e7151dd7616095 (diff) | |
download | gitlab-ce-c53890548e15c15b38f3aa7911a69a4c24173f15.tar.gz |
Resolve "Show CI pipeline status in Web IDE"
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 eb919241318..ce1069276ab 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)) |