diff --git a/app/serializers/rest/admin/webhook_event_serializer.rb b/app/serializers/rest/admin/webhook_event_serializer.rb index b6d2616e530..99da399ab77 100644 --- a/app/serializers/rest/admin/webhook_event_serializer.rb +++ b/app/serializers/rest/admin/webhook_event_serializer.rb @@ -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 diff --git a/app/serializers/rest/block_serializer.rb b/app/serializers/rest/block_serializer.rb new file mode 100644 index 00000000000..887237cd181 --- /dev/null +++ b/app/serializers/rest/block_serializer.rb @@ -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 diff --git a/app/serializers/rest/follow_serializer.rb b/app/serializers/rest/follow_serializer.rb new file mode 100644 index 00000000000..f7b9c507042 --- /dev/null +++ b/app/serializers/rest/follow_serializer.rb @@ -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 diff --git a/app/serializers/rest/mute_serializer.rb b/app/serializers/rest/mute_serializer.rb new file mode 100644 index 00000000000..06d3f90af12 --- /dev/null +++ b/app/serializers/rest/mute_serializer.rb @@ -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