summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-13 15:19:14 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-13 15:19:14 +0300
commit15c27192c0fa4e33188c3f6663362faca02df8af (patch)
tree2cbac2abf10cb88afdf03319c58f65ebd88c6cfd /lib/api/notes.rb
parentd3d0775acde8dbbb887665c3c52009d76e906d10 (diff)
parentd593c98fcbd34789068a72c9386f69a152107139 (diff)
downloadgitlab-ce-15c27192c0fa4e33188c3f6663362faca02df8af.tar.gz
Merge branch 'remove-wall'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: CHANGELOG
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb49
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index cb2bc764476..413faf0cf2d 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -6,55 +6,6 @@ module API
NOTEABLE_TYPES = [Issue, MergeRequest, Snippet]
resource :projects do
- # Get a list of project wall notes
- #
- # Parameters:
- # id (required) - The ID of a project
- # Example Request:
- # GET /projects/:id/notes
- get ":id/notes" do
- @notes = user_project.notes.common
-
- # Get recent notes if recent = true
- @notes = @notes.order('id DESC') if params[:recent]
-
- present paginate(@notes), with: Entities::Note
- end
-
- # Get a single project wall note
- #
- # Parameters:
- # id (required) - The ID of a project
- # note_id (required) - The ID of a note
- # Example Request:
- # GET /projects/:id/notes/:note_id
- get ":id/notes/:note_id" do
- @note = user_project.notes.common.find(params[:note_id])
- present @note, with: Entities::Note
- end
-
- # Create a new project wall note
- #
- # Parameters:
- # id (required) - The ID of a project
- # body (required) - The content of a note
- # Example Request:
- # POST /projects/:id/notes
- post ":id/notes" do
- required_attributes! [:body]
-
- @note = user_project.notes.new(note: params[:body])
- @note.author = current_user
-
- if @note.save
- present @note, with: Entities::Note
- else
- # :note is exposed as :body, but :note is set on error
- bad_request!(:note) if @note.errors[:note].any?
- not_found!
- end
- end
-
NOTEABLE_TYPES.each do |noteable_type|
noteables_str = noteable_type.to_s.underscore.pluralize
noteable_id_str = "#{noteable_type.to_s.underscore}_id"