1
0

muted_account_serializer.rb 294 B

12345678910
  1. # frozen_string_literal: true
  2. class REST::MutedAccountSerializer < REST::AccountSerializer
  3. attribute :mute_expires_at
  4. def mute_expires_at
  5. mute = current_user.account.mute_relationships.find_by(target_account_id: object.id)
  6. mute && !mute.expired? ? mute.expires_at : nil
  7. end
  8. end