diff options
author | Nick Thomas <nick@gitlab.com> | 2016-09-22 17:07:57 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-09-23 12:21:47 +0100 |
commit | af5e54f9ce4f491ccf605c7c74c137785da743a4 (patch) | |
tree | e26eed9d37826f7207e43b388a159d410134ce97 /app/assets/javascripts/api.js | |
parent | fd51f19c978023160ad759676a0363c12aea3fc8 (diff) | |
download | gitlab-ce-af5e54f9ce4f491ccf605c7c74c137785da743a4.tar.gz |
Convert label creation from API to controller endpoint
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 1cd2302111e..7e5e9fa9ae5 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -5,7 +5,7 @@ namespacesPath: "/api/:version/namespaces.json", groupProjectsPath: "/api/:version/groups/:id/projects.json", projectsPath: "/api/:version/projects.json?simple=true", - labelsPath: "/api/:version/projects/:id/labels", + labelsPath: "/:namespace_path/:project_path/labels", licensePath: "/api/:version/licenses/:key", gitignorePath: "/api/:version/gitignores/:key", gitlabCiYmlPath: "/api/:version/gitlab_ci_ymls/:key", @@ -65,13 +65,14 @@ return callback(projects); }); }, - newLabel: function(project_id, data, callback) { + newLabel: function(namespace_path, project_path, data, callback) { var url = Api.buildUrl(Api.labelsPath) - .replace(':id', project_id); + .replace(':namespace_path', namespace_path) + .replace(':project_path', project_path); return $.ajax({ url: url, type: "POST", - data: data, + data: {'label': data}, dataType: "json" }).done(function(label) { return callback(label); |