14 lines
336 B
Ruby
14 lines
336 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module AwardEmojis
|
||
|
class ToggleService < AwardEmojis::BaseService
|
||
|
def execute
|
||
|
if awardable.awarded_emoji?(name, current_user)
|
||
|
DestroyService.new(awardable, name, current_user).execute
|
||
|
else
|
||
|
AddService.new(awardable, name, current_user).execute
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|