0
0
Fork 0

Add in-app notifications for moderation actions/warnings (#30065)

This commit is contained in:
Claire 2024-04-25 19:26:05 +02:00 committed by GitHub
parent 0ec061aa8f
commit 4ef0b48b95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 188 additions and 21 deletions

View file

@ -7,6 +7,7 @@ class REST::NotificationSerializer < ActiveModel::Serializer
belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer
belongs_to :report, if: :report_type?, serializer: REST::ReportSerializer
belongs_to :account_relationship_severance_event, key: :event, if: :relationship_severance_event?, serializer: REST::AccountRelationshipSeveranceEventSerializer
belongs_to :account_warning, key: :moderation_warning, if: :moderation_warning_event?, serializer: REST::AccountWarningSerializer
def id
object.id.to_s
@ -23,4 +24,8 @@ class REST::NotificationSerializer < ActiveModel::Serializer
def relationship_severance_event?
object.type == :severed_relationships
end
def moderation_warning_event?
object.type == :moderation_warning
end
end