diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-06 01:21:02 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-12 14:24:05 +0200 |
commit | ba21c00f01bf4274d0e4cc3892293fc1e581b260 (patch) | |
tree | 1d9133b41f4e30b8775002c72ef78ec28d213ace /lib/api/notes.rb | |
parent | 734df1bb504aedec6a5668567de808b549a84749 (diff) | |
download | gitlab-ce-ba21c00f01bf4274d0e4cc3892293fc1e581b260.tar.gz |
Delete notes via API
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r-- | lib/api/notes.rb | 17 |
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 |