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
16
app/serializers/rest/account_warning_serializer.rb
Normal file
16
app/serializers/rest/account_warning_serializer.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::AccountWarningSerializer < ActiveModel::Serializer
|
||||
attributes :id, :action, :text, :status_ids, :created_at
|
||||
|
||||
has_one :target_account, serializer: REST::AccountSerializer
|
||||
has_one :appeal, serializer: REST::AppealSerializer
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def status_ids
|
||||
object&.status_ids&.map(&:to_s)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue