Commit 8a49cdc3b44579e64d50973df1a1d075e2766b97
1 parent
8d192adb
Exists in
master
and in
4 other branches
Add milestone API docs to doc/README and views/help/api
Also removes `closed` attribute option from create action.
Showing
4 changed files
with
14 additions
and
4 deletions
Show diff stats
app/views/help/api.html.haml
@@ -63,3 +63,13 @@ | @@ -63,3 +63,13 @@ | ||
63 | .file_content.wiki | 63 | .file_content.wiki |
64 | = preserve do | 64 | = preserve do |
65 | = markdown File.read(Rails.root.join("doc", "api", "issues.md")) | 65 | = markdown File.read(Rails.root.join("doc", "api", "issues.md")) |
66 | + | ||
67 | +%br | ||
68 | + | ||
69 | +.file_holder#milestones | ||
70 | + .file_title | ||
71 | + %i.icon-file | ||
72 | + Milestones | ||
73 | + .file_content.wiki | ||
74 | + = preserve do | ||
75 | + = markdown File.read(Rails.root.join("doc", "api", "milestones.md")) |
doc/api/README.md
@@ -29,3 +29,4 @@ The API uses JSON to serialize data. You don't need to specify `.json` at the en | @@ -29,3 +29,4 @@ The API uses JSON to serialize data. You don't need to specify `.json` at the en | ||
29 | + [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md) | 29 | + [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md) |
30 | + [Snippets](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/snippets.md) | 30 | + [Snippets](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/snippets.md) |
31 | + [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md) | 31 | + [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md) |
32 | ++ [Milestones](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/milestones.md) |
doc/api/milestones.md
@@ -34,10 +34,10 @@ POST /projects/:id/milestones | @@ -34,10 +34,10 @@ POST /projects/:id/milestones | ||
34 | Parameters: | 34 | Parameters: |
35 | 35 | ||
36 | + `id` (required) - The ID or code name of a project | 36 | + `id` (required) - The ID or code name of a project |
37 | ++ `milestone_id` (required) - The ID of a project milestone | ||
37 | + `title` (required) - The title of an milestone | 38 | + `title` (required) - The title of an milestone |
38 | + `description` (optional) - The description of the milestone | 39 | + `description` (optional) - The description of the milestone |
39 | + `due_date` (optional) - The due date of the milestone | 40 | + `due_date` (optional) - The due date of the milestone |
40 | -+ `closed` (optional) - The status of the milestone | ||
41 | 41 | ||
42 | ## Edit milestone | 42 | ## Edit milestone |
43 | 43 |
lib/api/milestones.rb
@@ -33,15 +33,13 @@ module Gitlab | @@ -33,15 +33,13 @@ module Gitlab | ||
33 | # title (required) - The title of the milestone | 33 | # title (required) - The title of the milestone |
34 | # description (optional) - The description of the milestone | 34 | # description (optional) - The description of the milestone |
35 | # due_date (optional) - The due date of the milestone | 35 | # due_date (optional) - The due date of the milestone |
36 | - # closed (optional) - The status of the milestone | ||
37 | # Example Request: | 36 | # Example Request: |
38 | # POST /projects/:id/milestones | 37 | # POST /projects/:id/milestones |
39 | post ":id/milestones" do | 38 | post ":id/milestones" do |
40 | @milestone = user_project.milestones.new( | 39 | @milestone = user_project.milestones.new( |
41 | title: params[:title], | 40 | title: params[:title], |
42 | description: params[:description], | 41 | description: params[:description], |
43 | - due_date: params[:due_date], | ||
44 | - closed: (params[:closed] || false) | 42 | + due_date: params[:due_date] |
45 | ) | 43 | ) |
46 | 44 | ||
47 | if @milestone.save | 45 | if @milestone.save |
@@ -55,6 +53,7 @@ module Gitlab | @@ -55,6 +53,7 @@ module Gitlab | ||
55 | # | 53 | # |
56 | # Parameters: | 54 | # Parameters: |
57 | # id (required) - The ID or code name of a project | 55 | # id (required) - The ID or code name of a project |
56 | + # milestone_id (required) - The ID of a project milestone | ||
58 | # title (optional) - The title of a milestone | 57 | # title (optional) - The title of a milestone |
59 | # description (optional) - The description of a milestone | 58 | # description (optional) - The description of a milestone |
60 | # due_date (optional) - The due date of a milestone | 59 | # due_date (optional) - The due date of a milestone |