Commit 93e8d426 authored by Valeriy Sizov's avatar Valeriy Sizov

API: merge request: post comment call

parent b32a8eea
......@@ -69,5 +69,10 @@ module Gitlab
:title, :closed, :merged
expose :author, :assignee, using: Entities::UserBasic
end
class Note < Grape::Entity
expose :author, using: Entities::UserBasic
expose :note
end
end
end
......@@ -52,6 +52,18 @@ module Gitlab
end
end
#post comment to merge request
post ":id/merge_request/:merge_request_id/comments" do
merge_request = user_project.merge_requests.find(params[:merge_request_id])
note = merge_request.notes.new(note: params[:note], project_id: user_project.id)
note.author = current_user
if note.save
present note, with: Entities::Note
else
not_found!
end
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