summaryrefslogtreecommitdiff
path: root/lib/api/v3/merge_requests.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-02-06 16:54:30 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-02-07 12:20:00 +0100
commit626e79b6f5ed18e1d023643d3e4b85dc4f20286c (patch)
treee1579e1f457f25ae2c511d8e812fa2956eef0e01 /lib/api/v3/merge_requests.rb
parent5985b55769303824f0ce64ae293b0498f2edfc1b (diff)
downloadgitlab-ce-626e79b6f5ed18e1d023643d3e4b85dc4f20286c.tar.gz
Split V3 entities into a separate fileapi-remove-snippets-expires-at
Diffstat (limited to 'lib/api/v3/merge_requests.rb')
-rw-r--r--lib/api/v3/merge_requests.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/api/v3/merge_requests.rb b/lib/api/v3/merge_requests.rb
index 1af70cf58cc..129f9d850e9 100644
--- a/lib/api/v3/merge_requests.rb
+++ b/lib/api/v3/merge_requests.rb
@@ -39,7 +39,7 @@ module API
desc 'List merge requests' do
detail 'iid filter is deprecated have been removed on V4'
- success Entities::MergeRequest
+ success ::API::Entities::MergeRequest
end
params do
optional :state, type: String, values: %w[opened closed merged all], default: 'all',
@@ -66,11 +66,11 @@ module API
end
merge_requests = merge_requests.reorder(params[:order_by] => params[:sort])
- present paginate(merge_requests), with: Entities::MergeRequest, current_user: current_user, project: user_project
+ present paginate(merge_requests), with: ::API::Entities::MergeRequest, current_user: current_user, project: user_project
end
desc 'Create a merge request' do
- success Entities::MergeRequest
+ success ::API::Entities::MergeRequest
end
params do
requires :title, type: String, desc: 'The title of the merge request'
@@ -89,7 +89,7 @@ module API
merge_request = ::MergeRequests::CreateService.new(user_project, current_user, mr_params).execute
if merge_request.valid?
- present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
+ present merge_request, with: ::API::Entities::MergeRequest, current_user: current_user, project: user_project
else
handle_merge_request_errors! merge_request.errors
end
@@ -114,34 +114,34 @@ module API
if status == :deprecated
detail DEPRECATION_MESSAGE
end
- success Entities::MergeRequest
+ success ::API::Entities::MergeRequest
end
get path do
merge_request = find_merge_request_with_access(params[:merge_request_id])
- present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
+ present merge_request, with: ::API::Entities::MergeRequest, current_user: current_user, project: user_project
end
desc 'Get the commits of a merge request' do
- success Entities::RepoCommit
+ success ::API::Entities::RepoCommit
end
get "#{path}/commits" do
merge_request = find_merge_request_with_access(params[:merge_request_id])
- present merge_request.commits, with: Entities::RepoCommit
+ present merge_request.commits, with: ::API::Entities::RepoCommit
end
desc 'Show the merge request changes' do
- success Entities::MergeRequestChanges
+ success ::API::Entities::MergeRequestChanges
end
get "#{path}/changes" do
merge_request = find_merge_request_with_access(params[:merge_request_id])
- present merge_request, with: Entities::MergeRequestChanges, current_user: current_user
+ present merge_request, with: ::API::Entities::MergeRequestChanges, current_user: current_user
end
desc 'Update a merge request' do
- success Entities::MergeRequest
+ success ::API::Entities::MergeRequest
end
params do
optional :title, type: String, allow_blank: false, desc: 'The title of the merge request'
@@ -162,14 +162,14 @@ module API
merge_request = ::MergeRequests::UpdateService.new(user_project, current_user, mr_params).execute(merge_request)
if merge_request.valid?
- present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
+ present merge_request, with: ::API::Entities::MergeRequest, current_user: current_user, project: user_project
else
handle_merge_request_errors! merge_request.errors
end
end
desc 'Merge a merge request' do
- success Entities::MergeRequest
+ success ::API::Entities::MergeRequest
end
params do
optional :merge_commit_message, type: String, desc: 'Custom merge commit message'
@@ -209,11 +209,11 @@ module API
.execute(merge_request)
end
- present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project
+ present merge_request, with: ::API::Entities::MergeRequest, current_user: current_user, project: user_project
end
desc 'Cancel merge if "Merge When Pipeline Succeeds" is enabled' do
- success Entities::MergeRequest
+ success ::API::Entities::MergeRequest
end
post "#{path}/cancel_merge_when_build_succeeds" do
merge_request = find_project_merge_request(params[:merge_request_id])
@@ -227,19 +227,19 @@ module API
desc 'Get the comments of a merge request' do
detail 'Duplicate. DEPRECATED and HAS BEEN REMOVED in V4'
- success Entities::MRNote
+ success ::API::Entities::MRNote
end
params do
use :pagination
end
get "#{path}/comments" do
merge_request = find_merge_request_with_access(params[:merge_request_id])
- present paginate(merge_request.notes.fresh), with: Entities::MRNote
+ present paginate(merge_request.notes.fresh), with: ::API::Entities::MRNote
end
desc 'Post a comment to a merge request' do
detail 'Duplicate. DEPRECATED and HAS BEEN REMOVED in V4'
- success Entities::MRNote
+ success ::API::Entities::MRNote
end
params do
requires :note, type: String, desc: 'The text of the comment'
@@ -256,14 +256,14 @@ module API
note = ::Notes::CreateService.new(user_project, current_user, opts).execute
if note.save
- present note, with: Entities::MRNote
+ present note, with: ::API::Entities::MRNote
else
render_api_error!("Failed to save note #{note.errors.messages}", 400)
end
end
desc 'List issues that will be closed on merge' do
- success Entities::MRNote
+ success ::API::Entities::MRNote
end
params do
use :pagination