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
21695d7f
Commit
21695d7f
authored
Nov 27, 2019
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract method to remove duplicated code
parent
3440fcb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
ee/lib/api/v3/github.rb
ee/lib/api/v3/github.rb
+6
-2
No files found.
ee/lib/api/v3/github.rb
View file @
21695d7f
...
...
@@ -78,6 +78,10 @@ module API
MergeRequestsFinder
.
new
(
current_user
,
authorized_only:
true
).
execute
end
def
authorized_merge_requests_for
(
project
)
MergeRequestsFinder
.
new
(
current_user
,
authorized_only:
true
,
project_id:
project
.
id
).
execute
end
# rubocop: disable CodeReuse/ActiveRecord
def
find_notes
(
noteable
)
# They're not presented on Jira Dev Panel ATM. A comments count with a
...
...
@@ -154,7 +158,7 @@ module API
get
':namespace/:project/pulls'
do
user_project
=
find_project_with_access
(
params
)
merge_requests
=
MergeRequestsFinder
.
new
(
current_user
,
authorized_only:
true
,
project_id:
user_project
.
id
).
execute
merge_requests
=
authorized_merge_requests_for
(
user_project
)
present
paginate
(
merge_requests
),
with:
::
API
::
Github
::
Entities
::
PullRequest
end
...
...
@@ -195,7 +199,7 @@ module API
get
':namespace/:project/events'
do
user_project
=
find_project_with_access
(
params
)
merge_requests
=
MergeRequestsFinder
.
new
(
current_user
,
authorized_only:
true
,
project_id:
user_project
.
id
).
execute
merge_requests
=
authorized_merge_requests_for
(
user_project
)
present
paginate
(
merge_requests
),
with:
::
API
::
Github
::
Entities
::
PullRequestEvent
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