diff options
author | Justin Whear <justin@economicmodeling.com> | 2014-06-03 03:10:38 +0400 |
---|---|---|
committer | Hannes Rosenögger <123haynes@gmail.com> | 2015-01-22 14:08:45 +0300 |
commit | 9d271538a8e9ddff892a084e5c8a881bf2fdb0b0 (patch) | |
tree | b52b11c433b0e0191c0257094021034ecc653e0e /lib/api/milestones.rb | |
parent | 2b10520b306697d7cbae8f3f84ca30cacc821fa4 (diff) |
Add per-milestone issues API call
Diffstat (limited to 'lib/api/milestones.rb')
-rw-r--r-- | lib/api/milestones.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/milestones.rb b/lib/api/milestones.rb index 2ea49359df0..ca01fa4a57d 100644 --- a/lib/api/milestones.rb +++ b/lib/api/milestones.rb @@ -75,6 +75,21 @@ module API render_api_error!("Failed to update milestone #{milestone.errors.messages}", 400) end end + + # Get all issues for single project milestone + # + # Parameters: + # id (required) - The ID of a project + # milestone_id (required) - The ID of a project milestone + # Example Request: + # GET /projects/:id/milestones/:milestone_id/issues + get ":id/milestones/:milestone_id/issues" do + authorize! :read_milestone, user_project + + @milestone = user_project.milestones.find(params[:milestone_id]) + present paginate(@milestone.issues), with: Entities::Issue + end + end end end |