summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/notes.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 9b39ff4c88f..84b6beb5c71 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -33,6 +33,21 @@ module Gitlab
@noteable = user_project.send(:"#{noteables_str}").find(params[:"#{noteable_id_str}"])
present paginate(@noteable.notes), with: Entities::Note
end
+
+ # Get a single +noteable+ note
+ #
+ # Parameters:
+ # id (required) - The ID or code name of a project
+ # noteable_id (required) - The ID of an issue or snippet
+ # note_id (required) - The ID of a note
+ # Example Request:
+ # GET /projects/:id/issues/:noteable_id/notes/:note_id
+ # GET /projects/:id/snippets/:noteable_id/notes/:note_id
+ get ":id/#{noteables_str}/:#{noteable_id_str}/notes/:note_id" do
+ @noteable = user_project.send(:"#{noteables_str}").find(params[:"#{noteable_id_str}"])
+ @note = @noteable.notes.find(params[:note_id])
+ present @note, with: Entities::Note
+ end
end
end
end