mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 18:15:30 +08:00
Add 'primary_group_name' to CurrentUserSerializer
This commit is contained in:
parent
9813f9f0f8
commit
19b7658dc3
@ -35,7 +35,9 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:automatically_unpin_topics,
|
||||
:mailing_list_mode,
|
||||
:previous_visit_at,
|
||||
:seen_notification_id
|
||||
:seen_notification_id,
|
||||
:primary_group_id,
|
||||
:primary_group_name
|
||||
|
||||
def include_site_flagged_posts_count?
|
||||
object.staff?
|
||||
@ -168,4 +170,16 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
object.user_option.mailing_list_mode
|
||||
end
|
||||
|
||||
def include_primary_group_id?
|
||||
object.primary_group_id.present?
|
||||
end
|
||||
|
||||
def primary_group_name
|
||||
object.primary_group.name.downcase
|
||||
end
|
||||
|
||||
def include_primary_group_name?
|
||||
object.primary_group&.name.present?
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user