mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Add follow, mute and block serializer
This commit is contained in:
parent
a2ccad787e
commit
3d28fb2157
4 changed files with 36 additions and 0 deletions
|
@ -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
|
||||
|
|
9
app/serializers/rest/block_serializer.rb
Normal file
9
app/serializers/rest/block_serializer.rb
Normal 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
|
11
app/serializers/rest/follow_serializer.rb
Normal file
11
app/serializers/rest/follow_serializer.rb
Normal 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
|
10
app/serializers/rest/mute_serializer.rb
Normal file
10
app/serializers/rest/mute_serializer.rb
Normal 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
|
Loading…
Reference in a new issue