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.coffee13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee
index 3e0fdb3f795..466b086259a 100644
--- a/app/assets/javascripts/api.js.coffee
+++ b/app/assets/javascripts/api.js.coffee
@@ -4,6 +4,7 @@
namespaces_path: "/api/:version/namespaces.json"
group_projects_path: "/api/:version/groups/:id/projects.json"
projects_path: "/api/:version/projects.json"
+ labels_path: "/api/:version/projects/:id/labels"
group: (group_id, callback) ->
url = Api.buildUrl(Api.group_path)
@@ -61,6 +62,18 @@
).done (projects) ->
callback(projects)
+ projectLabels: (project_id, callback) ->
+ url = Api.buildUrl(Api.labels_path)
+ url = url.replace(':id', project_id)
+
+ $.ajax(
+ url: url
+ data:
+ private_token: gon.api_token
+ dataType: "json"
+ ).done (labels) ->
+ callback(labels)
+
# Return group projects list. Filtered by query
groupProjects: (group_id, query, callback) ->
url = Api.buildUrl(Api.group_projects_path)