Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
9d271538
Commit
9d271538
authored
Jun 02, 2014
by
Justin Whear
Committed by
Hannes Rosenögger
Jan 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add per-milestone issues API call
parent
2b10520b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
lib/api/milestones.rb
lib/api/milestones.rb
+15
-0
spec/requests/api/milestones_spec.rb
spec/requests/api/milestones_spec.rb
+14
-0
No files found.
lib/api/milestones.rb
View file @
9d271538
...
...
@@ -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
spec/requests/api/milestones_spec.rb
View file @
9d271538
...
...
@@ -96,4 +96,18 @@ describe API::API, api: true do
state_event:
'close'
end
end
describe
"GET /projects/:id/milestones/:milestone_id/issues"
do
it
"should return project issues for a particular milestone"
do
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
,
user
)
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
first
[
'milestone'
][
'title'
].
should
==
milestone
.
title
end
it
"should return a 401 error if user not authenticated"
do
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
/issues"
)
response
.
status
.
should
==
401
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment