Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-04-06 02:21:02 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2016-04-12 15:24:05 +0300
commitba21c00f01bf4274d0e4cc3892293fc1e581b260 (patch)
tree1d9133b41f4e30b8775002c72ef78ec28d213ace /lib
parent734df1bb504aedec6a5668567de808b549a84749 (diff)
Delete notes via API
Diffstat (limited to 'lib')
-rw-r--r--lib/api/notes.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 174473f5371..fd1704d395c 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -112,6 +112,23 @@ module API
end
end
+ # Delete a +notable+ note
+ #
+ # Parameters:
+ # Parameters:
+ # id (required) - The ID of a project
+ # noteable_id (required) - The ID of an issue, MR, or snippet
+ # node_id (required) - The ID of a note
+ # Example Request:
+ # DELETE /projects/:id/issues/:noteable_id/notes/:note_id
+ # DELETE /projects/:id/snippets/:noteable_id/notes/:node_id
+ delete ":id/#{noteables_str}/:#{noteable_id_str}/notes/:note_id" do
+ note = user_project.notes.find(params[:note_id])
+ not_found!('Note') unless note
+ authorize! :admin_note, note
+ ::Notes::DeleteService.new(user_project, current_user).execute(note)
+ true
+ end
end
end
end