1
0
Fork 0
forked from gitea/nas

Add emoji icon support on notification (expects custom)

This commit is contained in:
KMY 2023-02-27 14:16:29 +09:00
parent b242a89e63
commit 1df6e80ee0
5 changed files with 17 additions and 4 deletions

View file

@ -6,6 +6,7 @@ class REST::NotificationSerializer < ActiveModel::Serializer
belongs_to :from_account, key: :account, serializer: REST::AccountSerializer
belongs_to :target_status, key: :status, if: :status_type?, serializer: REST::StatusSerializer
belongs_to :report, if: :report_type?, serializer: REST::ReportSerializer
belongs_to :emoji_reaction, if: :emoji_reaction_type?, serializer: REST::EmojiReactionSerializer
def id
object.id.to_s
@ -18,4 +19,8 @@ class REST::NotificationSerializer < ActiveModel::Serializer
def report_type?
object.type == :'admin.report'
end
def emoji_reaction_type?
object.type == :emoji_reaction
end
end