summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-08-31 20:50:05 -0700
committerStan Hu <stanhu@gmail.com>2017-08-31 20:50:05 -0700
commitf045903541ace5cf4fd3c6e4a05ecfd264c1c621 (patch)
treeee6aaf013d92766e7184b3e0772e1e5fa99a20e4 /lib/api/notes.rb
parentf2c60eba25fc001974a61373bc380528416932a2 (diff)
parent8713afe61fb1beaff4d550a60b88d274c47006ea (diff)
downloadgitlab-ce-f045903541ace5cf4fd3c6e4a05ecfd264c1c621.tar.gz
Merge branch 'master' into sh-headless-chrome-support
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 4e4e473994b..e116448c15b 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -129,10 +129,12 @@ module API
end
delete ":id/#{noteables_str}/:noteable_id/notes/:note_id" do
note = user_project.notes.find(params[:note_id])
+
authorize! :admin_note, note
- status 204
- ::Notes::DestroyService.new(user_project, current_user).execute(note)
+ destroy_conditionally!(note) do |note|
+ ::Notes::DestroyService.new(user_project, current_user).execute(note)
+ end
end
end
end