about summary refs log tree commit diff
path: root/app/services/remove_featured_tag_service.rb
blob: 2aa70e8fc6f860ccd6514832c0308b9888229806 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class RemoveFeaturedTagService < BaseService
  include Payloadable

  def call(account, featured_tag)
    @account = account

    featured_tag.destroy!
    ActivityPub::AccountRawDistributionWorker.perform_async(build_json(featured_tag), account.id) if @account.local?
  end

  private

  def build_json(featured_tag)
    Oj.dump(serialize_payload(featured_tag, ActivityPub::RemoveSerializer, signer: @account))
  end
end