about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-09 09:56:53 +0200
committerGitHub <noreply@github.com>2018-08-09 09:56:53 +0200
commitf2404de871f0bdfda5c9aeeeb4c6c4d10a8da8ab (patch)
treef45577d1fe26ea56f7323b940f506f8875d7344e /app/serializers/rest
parent80176a3814abad7f5c9023f97b5d4d82b73c089d (diff)
Public profile endorsements (accounts picked by profile owner) (#8146)
Diffstat (limited to 'app/serializers/rest')
-rw-r--r--app/serializers/rest/relationship_serializer.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/serializers/rest/relationship_serializer.rb b/app/serializers/rest/relationship_serializer.rb
index 45bfd4d6e..c6c722a54 100644
--- a/app/serializers/rest/relationship_serializer.rb
+++ b/app/serializers/rest/relationship_serializer.rb
@@ -2,7 +2,8 @@
 
 class REST::RelationshipSerializer < ActiveModel::Serializer
   attributes :id, :following, :showing_reblogs, :followed_by, :blocking,
-             :muting, :muting_notifications, :requested, :domain_blocking
+             :muting, :muting_notifications, :requested, :domain_blocking,
+             :endorsed
 
   def id
     object.id.to_s
@@ -41,4 +42,8 @@ class REST::RelationshipSerializer < ActiveModel::Serializer
   def domain_blocking
     instance_options[:relationships].domain_blocking[object.id] || false
   end
+
+  def endorsed
+    instance_options[:relationships].endorsed[object.id] || false
+  end
 end