diff options
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 85eb08cc97d..093762e823e 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -31,6 +31,7 @@ const Api = { branchSinglePath: '/api/:version/projects/:id/repository/branches/:branch', createBranchPath: '/api/:version/projects/:id/repository/branches', releasesPath: '/api/:version/projects/:id/releases', + projectRemoteMirrorPath: '/api/:version/projects/:project_id/remote_mirrors/:remote_mirror_id', group(groupId, callback) { const url = Api.buildUrl(Api.groupPath).replace(':id', groupId); @@ -321,6 +322,14 @@ const Api = { return axios.get(url); }, + deleteProjectRemoteMirror(projectId, remoteMirrorId) { + const url = Api.buildUrl(this.projectRemoteMirrorPath) + .replace(':project_id', encodeURIComponent(projectId)) + .replace(':remote_mirror_id', remoteMirrorId); + + return axios.delete(url).then(({ data }) => data); + }, + buildUrl(url) { let urlRoot = ''; if (gon.relative_url_root != null) { |