Define a serializer for /api/v1/mutes/details
This commit is contained in:
15
app/serializers/rest/mute_serializer.rb
Normal file
15
app/serializers/rest/mute_serializer.rb
Normal file
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::MuteSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :account, :target_account, :created_at, :hide_notifications
|
||||
|
||||
def account
|
||||
REST::AccountSerializer.new(object.account)
|
||||
end
|
||||
|
||||
def target_account
|
||||
REST::AccountSerializer.new(object.target_account)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user