mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-02 13:03:05 -05:00
Do not render note in RelationshipSerializer (#193)
RelationshipSerializer is used to render an Account's block/mute/follow/etc. relationships; there won't be a note present on an Account. We'll need to look at a different serializer to render notes.
This commit is contained in:
parent
041168df31
commit
8f476ee39e
@ -2,17 +2,12 @@
|
||||
|
||||
class REST::RelationshipSerializer < ActiveModel::Serializer
|
||||
attributes :id, :following, :showing_reblogs, :followed_by, :blocking,
|
||||
:muting, :muting_notifications, :requested, :domain_blocking,
|
||||
:note
|
||||
:muting, :muting_notifications, :requested, :domain_blocking
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def note
|
||||
object.respond_to?(:note) ? object.note&.text : nil
|
||||
end
|
||||
|
||||
def following
|
||||
instance_options[:relationships].following[object.id] ? true : false
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user