diff options
author | Phil Hughes <me@iamphill.com> | 2018-06-14 18:03:17 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-06-27 10:44:12 +0100 |
commit | e5d42a0f177c0ce2bc922064cfa162e50287815a (patch) | |
tree | b7c9c6db9024716aa55cc3de0155accae9ba0cc5 /app/assets/javascripts/api.js | |
parent | 2452f1a73e8dcf646311c6069a077ab66be5ce51 (diff) | |
download | gitlab-ce-e5d42a0f177c0ce2bc922064cfa162e50287815a.tar.gz |
Improve branch 404 error in Web IDE
Part of #47323
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 000938e475f..d62fae99c6b 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -243,6 +243,15 @@ const Api = { }); }, + createBranch(id, { ref, branch }) { + const url = Api.buildUrl(this.createBranchPath).replace(':id', encodeURIComponent(id)); + + return axios.post(url, { + ref, + branch, + }); + }, + buildUrl(url) { let urlRoot = ''; if (gon.relative_url_root != null) { |