summaryrefslogtreecommitdiff
path: root/app/services/award_emojis/toggle_service.rb
blob: 812dd1c28899f8c7c6ada0c8413c664385619d12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# 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