Expose reaction ids

This commit is contained in:
Essem 2024-02-09 17:37:08 -06:00
parent 0a6eaa16dc
commit 2ab563e06c
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -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