Add in-app notifications for moderation actions/warnings (#30065)
This commit is contained in:
parent
0ec061aa8f
commit
4ef0b48b95
13 changed files with 188 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue