remove_featured_tag_service.rb 453 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. class RemoveFeaturedTagService < BaseService
  3. include Payloadable
  4. def call(account, featured_tag)
  5. @account = account
  6. featured_tag.destroy!
  7. ActivityPub::AccountRawDistributionWorker.perform_async(build_json(featured_tag), account.id) if @account.local?
  8. end
  9. private
  10. def build_json(featured_tag)
  11. Oj.dump(serialize_payload(featured_tag, ActivityPub::RemoveSerializer, signer: @account))
  12. end
  13. end