diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-12 14:34:50 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-12 14:34:50 +0000 |
commit | e322b993e701f40fc515539cd58adec22a30c61d (patch) | |
tree | 2c4bd7c94140fb3c5ae582985f7b9e376315e837 /lib | |
parent | a5512099cec6219261ac821775f0cc02e99bc1a6 (diff) | |
parent | dc39c8372d760eceba50a35505dad8663b9e851e (diff) | |
download | gitlab-ce-e322b993e701f40fc515539cd58adec22a30c61d.tar.gz |
Merge branch 'api-delete-note' into 'master'
Delete notes via API
Supports deleting issues, snippets, and merge requests via the API.
* Closes #14944
* Closes #14845
* Closes #6060
@zj I did not see that you assigned yourself in #6060. Hopefully, you did not start yet.
@rymai In #6060 this is targeted for 8.7 release. Could you review that and maybe this still lands in 8.7.
See merge request !3557
Diffstat (limited to 'lib')
-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..a1c98f5e8ff 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -112,6 +112,23 @@ module API end end + # Delete a +noteable+ note + # + # 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]) + authorize! :admin_note, note + + ::Notes::DeleteService.new(user_project, current_user).execute(note) + + present note, with: Entities::Note + end end end end |