Add follow, mute and block serializer

This commit is contained in:
CSDUMMI 2024-08-04 13:00:02 +02:00
parent a2ccad787e
commit 3d28fb2157
4 changed files with 36 additions and 0 deletions

View file

@ -9,6 +9,12 @@ class REST::Admin::WebhookEventSerializer < ActiveModel::Serializer
REST::Admin::ReportSerializer
when 'Status'
REST::StatusSerializer
when 'Follow'
REST::FollowSerializer
when 'Mute'
REST::MuteSerializer
when 'Block'
REST::BlockSerializer
else
super
end

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class REST::BlockSerializer < ActiveModel::Serializer
attributes :id, :created_at, :updated_at, :account_id, :target_account_id, :uri
def id
object.id.to_s
end
end

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
class REST::FollowSerializer < ActiveModel::Serializer
attributes :id, :created_at, :updated_at, :account_id,
:target_account_id, :show_reblogs, :uri,
:notify, :languages
def id
object.id.to_s
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
class REST::MuteSerializer < ActiveModel::Serializer
attributes :id, :created_at, :updated_at, :hide_notifications,
:account_id, :target_account_id, :expires_at
def id
object.id.to_s
end
end