Commit 9da87709 authored by Jacob Schatz's avatar Jacob Schatz

Remove api calls from api.js.coffee.

Using respond to instead
parent d17b5499
...@@ -5,45 +5,6 @@ ...@@ -5,45 +5,6 @@
group_projects_path: "/api/:version/groups/:id/projects.json" group_projects_path: "/api/:version/groups/:id/projects.json"
projects_path: "/api/:version/projects.json" projects_path: "/api/:version/projects.json"
labels_path: "/api/:version/projects/:id/labels" labels_path: "/api/:version/projects/:id/labels"
issues_paths:
update : "/api/:version/projects/:id/issues/:issue_id"
merge_request_path: "/api/:version/issues/:id.json"
milestones_paths:
index: "/api/:version/projects/:id/milestones"
milestones:
index: (project_id, callback) ->
data = {}
url = Api.buildUrl(Api.milestones_paths.index)
url = url
.replace(":id", project_id)
data.private_token = gon.api_token
$.ajax(
url: url
type: "GET"
data: data
dataType: "json"
).done (milestones) ->
if callback?
callback(milestones)
issues:
update: (project_id, issue_id, data, callback) ->
url = Api.buildUrl(Api.issues_paths.update)
url = url
.replace(":id", project_id)
.replace(":issue_id", issue_id)
if not data?
data = {}
data.private_token = gon.api_token
$.ajax(
url: url
type: "PUT"
data: data
dataType: "json"
).done (issue) ->
if callback?
callback(issue)
group: (group_id, callback) -> group: (group_id, callback) ->
url = Api.buildUrl(Api.group_path) url = Api.buildUrl(Api.group_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment