2024-03-07 15:53:37 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class REST::NotificationPolicySerializer < ActiveModel::Serializer
|
2024-06-18 15:23:30 +02:00
|
|
|
# Please update `app/javascript/mastodon/api_types/notification_policies.ts` when making changes to the attributes
|
|
|
|
|
2024-08-09 15:30:55 +02:00
|
|
|
attributes :for_not_following,
|
|
|
|
:for_not_followers,
|
|
|
|
:for_new_accounts,
|
|
|
|
:for_private_mentions,
|
|
|
|
:for_limited_accounts,
|
2024-03-07 15:53:37 +01:00
|
|
|
:summary
|
|
|
|
|
|
|
|
def summary
|
|
|
|
{
|
2024-04-02 12:06:26 +02:00
|
|
|
pending_requests_count: object.pending_requests_count.to_i,
|
|
|
|
pending_notifications_count: object.pending_notifications_count.to_i,
|
2024-03-07 15:53:37 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|