summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/api.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/api.js.coffee')
-rw-r--r--app/assets/javascripts/api.js.coffee14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee
index 987815b6bda..36c6a76e09c 100644
--- a/app/assets/javascripts/api.js.coffee
+++ b/app/assets/javascripts/api.js.coffee
@@ -75,6 +75,20 @@
).done (labels) ->
callback(labels)
+ newLabel: (project_id, data, callback) ->
+ url = Api.buildUrl(Api.labels_path)
+ url = url.replace(':id', project_id)
+
+ data.private_token = gon.api_token
+ $.ajax(
+ url: url
+ type: "POST"
+ data: data
+ dataType: "json"
+ ).done (label) ->
+ callback(label)
+
+
milestones: (project_id, callback) ->
url = Api.buildUrl(Api.milestones_path)
url = url.replace(':id', project_id)