diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-08-28 11:43:35 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-09-12 11:34:54 +0200 |
commit | 25140ec8ed74cc5ea5f50f05325f0d4a7f8753fd (patch) | |
tree | 3bfcb2944b2a6150eef40638db25004322cbfd98 /server/sonar-web/src/main/js/api/branches.ts | |
parent | 030370cf6255d1185ecb3deeaab7de1fe76e058b (diff) | |
download | sonarqube-25140ec8ed74cc5ea5f50f05325f0d4a7f8753fd.tar.gz sonarqube-25140ec8ed74cc5ea5f50f05325f0d4a7f8753fd.zip |
SONAR-9756 Build UI for branch management (#2433)
Diffstat (limited to 'server/sonar-web/src/main/js/api/branches.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/branches.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/branches.ts b/server/sonar-web/src/main/js/api/branches.ts index 6435c575aae..ec3e79e0932 100644 --- a/server/sonar-web/src/main/js/api/branches.ts +++ b/server/sonar-web/src/main/js/api/branches.ts @@ -17,9 +17,17 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { getJSON } from '../helpers/request'; +import { getJSON, post } from '../helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; export function getBranches(project: string): Promise<any> { return getJSON('/api/project_branches/list', { project }).then(r => r.branches, throwGlobalError); } + +export function deleteBranch(project: string, branch: string): Promise<void | Response> { + return post('/api/project_branches/delete', { project, branch }).catch(throwGlobalError); +} + +export function renameBranch(project: string, branch: string): Promise<void | Response> { + return post('/api/project_branches/rename', { project, branch }).catch(throwGlobalError); +} |