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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2d79e081
Commit
2d79e081
authored
Aug 10, 2020
by
Ash McKenzie
Committed by
James Ramsay
Aug 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create 'alias' routes for Epics
parent
e083e5cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
ee/lib/api/epic_issues.rb
ee/lib/api/epic_issues.rb
+7
-5
ee/lib/api/epics.rb
ee/lib/api/epics.rb
+7
-5
No files found.
ee/lib/api/epic_issues.rb
View file @
2d79e081
...
...
@@ -55,12 +55,14 @@ module API
params
do
requires
:epic_iid
,
type:
Integer
,
desc:
'The iid of the epic'
end
get
':id/(-/)epics/:epic_iid/issues'
do
authorize_can_read!
[
':id/epics/:epic_iid/issues'
,
':id/-/epics/:epic_iid/issues'
].
each
do
|
path
|
get
path
do
authorize_can_read!
present
epic
.
issues_readable_by
(
current_user
),
with:
EE
::
API
::
Entities
::
EpicIssue
,
current_user:
current_user
present
epic
.
issues_readable_by
(
current_user
),
with:
EE
::
API
::
Entities
::
EpicIssue
,
current_user:
current_user
end
end
desc
'Assign an issue to the epic'
do
...
...
ee/lib/api/epics.rb
View file @
2d79e081
...
...
@@ -39,12 +39,14 @@ module API
optional
:my_reaction_emoji
,
type:
String
,
desc:
'Return epics reacted by the authenticated user by the given emoji'
use
:pagination
end
get
':id/(-/)epics'
do
epics
=
paginate
(
find_epics
(
finder_params:
{
group_id:
user_group
.
id
})).
with_api_entity_associations
[
':id/epics'
,
':id/-/epics'
].
each
do
|
path
|
get
path
do
epics
=
paginate
(
find_epics
(
finder_params:
{
group_id:
user_group
.
id
})).
with_api_entity_associations
# issuable_metadata has to be set because `Entities::Epic` doesn't inherit from `Entities::IssuableEntity`
extra_options
=
{
issuable_metadata:
Gitlab
::
IssuableMetadata
.
new
(
current_user
,
epics
).
data
,
with_labels_details:
declared_params
[
:with_labels_details
]
}
present
epics
,
epic_options
.
merge
(
extra_options
)
# issuable_metadata has to be set because `Entities::Epic` doesn't inherit from `Entities::IssuableEntity`
extra_options
=
{
issuable_metadata:
Gitlab
::
IssuableMetadata
.
new
(
current_user
,
epics
).
data
,
with_labels_details:
declared_params
[
:with_labels_details
]
}
present
epics
,
epic_options
.
merge
(
extra_options
)
end
end
desc
'Get details of an epic'
do
...
...
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