Change account rest api property dissubscribable to subscribable

This commit is contained in:
KMY 2023-04-26 12:09:57 +09:00
parent c82781449d
commit 1206fa9334

View file

@ -5,7 +5,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
include FormattingHelper
attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :group, :created_at,
:note, :url, :avatar, :avatar_static, :header, :header_static, :searchability, :dissubscribable,
:note, :url, :avatar, :avatar_static, :header, :header_static, :searchability, :subscribable,
:followers_count, :following_count, :statuses_count, :last_status_at
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
@ -106,6 +106,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
object.suspended? ? false : object.discoverable
end
def subscribable
!object.dissubscribable
end
def moved_to_account
object.suspended? ? nil : AccountDecorator.new(object.moved_to_account)
end