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
68ea2f93
Commit
68ea2f93
authored
Dec 12, 2016
by
http://jneen.net/
Committed by
Bryce Johnson
Dec 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add json actions for approvals/approve/unapprove
parent
4d1497ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+19
-1
config/routes/project.rb
config/routes/project.rb
+4
-1
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
68ea2f93
...
...
@@ -496,11 +496,29 @@ class Projects::MergeRequestsController < Projects::ApplicationController
new
(
project
,
current_user
).
execute
(
@merge_request
)
redirect_to
merge_request_path
(
@merge_request
)
render_approvals_json
end
def
approvals
render_approvals_json
end
def
unapprove
if
merge_request
.
has_approved?
(
current_user
)
MergeRequests
::
RemoveApprovalService
.
new
(
project
,
current_user
).
execute
(
@merge_request
)
end
render_approvals_json
end
protected
def
render_approvals_json
render
json:
API
::
Entities
::
MergeRequestApprovals
.
new
(
@merge_request
)
end
def
selected_target_project
if
@project
.
id
.
to_s
==
params
[
:target_project_id
]
||
@project
.
forked_project_link
.
nil?
@project
...
...
config/routes/project.rb
View file @
68ea2f93
...
...
@@ -96,7 +96,10 @@ constraints(ProjectUrlConstrainer.new) do
post
:toggle_subscription
## EE-specific
post
:approve
get
:approvals
post
:approvals
,
to: :approve
delete
:approvals
,
to: :unapprove
post
:rebase
## EE-specific
...
...
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