diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 15:08:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 15:08:00 +0300 |
commit | 1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae (patch) | |
tree | ddb78a8a0d1350dc767f049a21e0f7d37edaa82c /app/assets/javascripts/api.js | |
parent | b11f7057d067885619ee3e513751f180b2e8ad85 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 14381f63e4b..797eaf629bf 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -41,6 +41,8 @@ const Api = { createBranchPath: '/api/:version/projects/:id/repository/branches', releasesPath: '/api/:version/projects/:id/releases', releasePath: '/api/:version/projects/:id/releases/:tag_name', + releaseLinksPath: '/api/:version/projects/:id/releases/:tag_name/assets/links', + releaseLinkPath: '/api/:version/projects/:id/releases/:tag_name/assets/links/:link_id', mergeRequestsPipeline: '/api/:version/projects/:id/merge_requests/:merge_request_iid/pipelines', adminStatisticsPath: '/api/:version/application/statistics', pipelineSinglePath: '/api/:version/projects/:id/pipelines/:pipeline_id', @@ -460,6 +462,23 @@ const Api = { return axios.put(url, release); }, + createReleaseLink(projectPath, tagName, link) { + const url = Api.buildUrl(this.releaseLinksPath) + .replace(':id', encodeURIComponent(projectPath)) + .replace(':tag_name', encodeURIComponent(tagName)); + + return axios.post(url, link); + }, + + deleteReleaseLink(projectPath, tagName, linkId) { + const url = Api.buildUrl(this.releaseLinkPath) + .replace(':id', encodeURIComponent(projectPath)) + .replace(':tag_name', encodeURIComponent(tagName)) + .replace(':link_id', encodeURIComponent(linkId)); + + return axios.delete(url); + }, + adminStatistics() { const url = Api.buildUrl(this.adminStatisticsPath); return axios.get(url); |