diff --git a/app/serializers/rest/status_reaction_serializer.rb b/app/serializers/rest/status_reaction_serializer.rb index cdf779f3a0..701c20dd95 100644 --- a/app/serializers/rest/status_reaction_serializer.rb +++ b/app/serializers/rest/status_reaction_serializer.rb @@ -5,7 +5,8 @@ class REST::StatusReactionSerializer < ActiveModel::Serializer attributes :name - attribute :me, if: :current_user? + attribute :id, unless: :no_id? + attribute :me, if: :current_user? # are this and count worth keeping? attribute :url, if: :custom_emoji? attribute :static_url, if: :custom_emoji? attribute :count, if: :respond_to_count? @@ -18,6 +19,10 @@ class REST::StatusReactionSerializer < ActiveModel::Serializer object.respond_to?(:count) end + def no_id? + object.id.nil? + end + def current_user? !current_user.nil? end