Commit bd049e5e authored by Valeriy Sizov's avatar Valeriy Sizov

API:merge request show && list

parent 42abdf69
......@@ -18,5 +18,6 @@ module Gitlab
mount Issues
mount Milestones
mount Session
mount MergeRequests
end
end
......@@ -63,5 +63,11 @@ module Gitlab
class SSHKey < Grape::Entity
expose :id, :title, :key
end
class MergeRequest < Grape::Entity
expose :id, :target_branch, :source_branch, :project_id,
:title, :closed, :merged
expose :author, :assignee, using: Entities::UserBasic
end
end
end
module Gitlab
# Issues API
class MergeRequests < Grape::API
before { authenticate! }
resource :projects do
#list
get ":id/merge_requests" do
project = current_user.projects.find(params[:id])
present project.merge_requests, with: Entities::MergeRequest
end
#show
get ":id/merge_request/:merge_request_id" do
project = current_user.projects.find(params[:id])
present project.merge_requests.find(params[:merge_request_id]), with: Entities::MergeRequest
end
#create merge_request
post ":id/merge_requests" do
end
#update merge_request
put ":id/merge_request/:merge_request_id" do
end
end
end
end
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