summaryrefslogtreecommitdiff
path: root/lib/api/award_emoji.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-03-02 13:14:13 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2017-08-28 16:40:25 +0200
commite80313f9ee5b3495a8713e6ddae111bc8106155b (patch)
treef1327448ef9e837aedb9fde9a50d6531e42a6112 /lib/api/award_emoji.rb
parent998afa5f74558be215a924d95aa131a69831ca43 (diff)
downloadgitlab-ce-e80313f9ee5b3495a8713e6ddae111bc8106155b.tar.gz
Conditionally destroy a ressource
Diffstat (limited to 'lib/api/award_emoji.rb')
-rw-r--r--lib/api/award_emoji.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/api/award_emoji.rb b/lib/api/award_emoji.rb
index 51a8587d26e..8e3851640da 100644
--- a/lib/api/award_emoji.rb
+++ b/lib/api/award_emoji.rb
@@ -85,12 +85,10 @@ module API
end
delete "#{endpoint}/:award_id" do
award = awardable.award_emoji.find(params[:award_id])
- check_unmodified_since(award.updated_at)
unauthorized! unless award.user == current_user || current_user.admin?
- status 204
- award.destroy
+ destroy_conditionally!(award)
end
end
end