Remove unsafed api emoji_reactions slim

This commit is contained in:
KMY 2023-09-21 16:23:37 +09:00
parent e84eb3fc81
commit dd51fae42f
5 changed files with 0 additions and 95 deletions

View file

@ -1,27 +0,0 @@
# frozen_string_literal: true
class REST::EmojiReactedBySlimReactionSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :name
attribute :url, if: :custom_emoji?
attribute :static_url, if: :custom_emoji?
attribute :domain, if: :custom_emoji?
def url
full_asset_url(object.custom_emoji.image.url)
end
def static_url
full_asset_url(object.custom_emoji.image.url(:static))
end
def domain
object.custom_emoji.domain
end
def custom_emoji?
object.custom_emoji.present?
end
end

View file

@ -1,20 +0,0 @@
# frozen_string_literal: true
class REST::EmojiReactedBySlimSerializer < ActiveModel::Serializer
belongs_to :account, serializer: REST::AccountSerializer
has_many :emoji_reactions, serializer: REST::EmojiReactedBySlimReactionSerializer
def attributes
{ account => emoji_reactions }
end
private
def account
object.first
end
def emoji_reactions
object.last
end
end