Add blocked_by
relationship to the REST API (#10373)
This commit is contained in:
parent
e6cfa7ab89
commit
9745de883b
2 changed files with 10 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::RelationshipSerializer < ActiveModel::Serializer
|
||||
attributes :id, :following, :showing_reblogs, :followed_by, :blocking,
|
||||
attributes :id, :following, :showing_reblogs, :followed_by, :blocking, :blocked_by,
|
||||
:muting, :muting_notifications, :requested, :domain_blocking,
|
||||
:endorsed
|
||||
|
||||
|
@ -27,6 +27,10 @@ class REST::RelationshipSerializer < ActiveModel::Serializer
|
|||
instance_options[:relationships].blocking[object.id] || false
|
||||
end
|
||||
|
||||
def blocked_by
|
||||
instance_options[:relationships].blocked_by[object.id] || false
|
||||
end
|
||||
|
||||
def muting
|
||||
instance_options[:relationships].muting[object.id] ? true : false
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue