Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
93e8d426
Commit
93e8d426
authored
Oct 21, 2012
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: merge request: post comment call
parent
b32a8eea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
lib/api/entities.rb
lib/api/entities.rb
+5
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+12
-0
No files found.
lib/api/entities.rb
View file @
93e8d426
...
...
@@ -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
lib/api/merge_requests.rb
View file @
93e8d426
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment