Commit fe59547a authored by Valeriy Sizov's avatar Valeriy Sizov

API: create merge request

parent bd049e5e
......@@ -18,7 +18,17 @@ module Gitlab
#create merge_request
post ":id/merge_requests" do
attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title]
project = current_user.projects.find(params[:id])
merge_request = project.merge_requests.new(attrs)
merge_request.author = current_user
if merge_request.save
merge_request.reload_code
present merge_request, with: Entities::MergeRequest
else
not_found!
end
end
#update merge_request
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment