2024-03-07 06:53:37 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class REST::NotificationPolicySerializer < ActiveModel::Serializer
|
2024-06-18 06:23:30 -07:00
|
|
|
# Please update `app/javascript/mastodon/api_types/notification_policies.ts` when making changes to the attributes
|
|
|
|
|
2024-03-07 06:53:37 -08:00
|
|
|
attributes :filter_not_following,
|
|
|
|
:filter_not_followers,
|
|
|
|
:filter_new_accounts,
|
|
|
|
:filter_private_mentions,
|
|
|
|
:summary
|
|
|
|
|
|
|
|
def summary
|
|
|
|
{
|
2024-04-02 03:06:26 -07:00
|
|
|
pending_requests_count: object.pending_requests_count.to_i,
|
|
|
|
pending_notifications_count: object.pending_notifications_count.to_i,
|
2024-03-07 06:53:37 -08:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|