diff options
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 64812e52849..8d46ea76be1 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -93,6 +93,7 @@ const Api = { groupNotificationSettingsPath: '/api/:version/groups/:id/notification_settings', notificationSettingsPath: '/api/:version/notification_settings', deployKeysPath: '/api/:version/deploy_keys', + secureFilePath: '/api/:version/projects/:project_id/secure_files/:secure_file_id', secureFilesPath: '/api/:version/projects/:project_id/secure_files', dependencyProxyPath: '/api/:version/groups/:id/dependency_proxy/cache', @@ -857,6 +858,14 @@ const Api = { }); }, + tag(id, tagName) { + const url = Api.buildUrl(this.tagPath) + .replace(':id', encodeURIComponent(id)) + .replace(':tag_name', encodeURIComponent(tagName)); + + return axios.get(url); + }, + freezePeriods(id) { const url = Api.buildUrl(this.freezePeriodsPath).replace(':id', encodeURIComponent(id)); @@ -970,6 +979,22 @@ const Api = { return axios.get(url, { params: { per_page: DEFAULT_PER_PAGE, ...options } }); }, + uploadProjectSecureFile(projectId, fileData) { + const url = Api.buildUrl(this.secureFilesPath).replace(':project_id', projectId); + + const headers = { 'Content-Type': 'multipart/form-data' }; + + return axios.post(url, fileData, { headers }); + }, + + deleteProjectSecureFile(projectId, secureFileId) { + const url = Api.buildUrl(this.secureFilePath) + .replace(':project_id', projectId) + .replace(':secure_file_id', secureFileId); + + return axios.delete(url); + }, + async updateNotificationSettings(projectId, groupId, data = {}) { let url = Api.buildUrl(this.notificationSettingsPath); |