API: update merge request call
This commit is contained in:
parent
fe59547ae5
commit
5a89934af8
1 changed files with 11 additions and 1 deletions
|
@ -33,7 +33,17 @@ module Gitlab
|
|||
|
||||
#update merge_request
|
||||
put ":id/merge_request/:merge_request_id" do
|
||||
|
||||
attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :closed]
|
||||
project = current_user.projects.find(params[:id])
|
||||
merge_request = project.merge_requests.find(params[:merge_request_id])
|
||||
|
||||
if merge_request.update_attributes attrs
|
||||
merge_request.reload_code
|
||||
merge_request.mark_as_unchecked
|
||||
present merge_request, with: Entities::MergeRequest
|
||||
else
|
||||
not_found!
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue