FIX: add status to channel membership serializer (#25906)

This commit is contained in:
David Battersby 2024-02-27 18:23:59 +08:00 committed by GitHub
parent 7a14831695
commit fe851a533a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -2,10 +2,11 @@
module Chat
class UserChannelMembershipSerializer < BaseChannelMembershipSerializer
has_one :user, serializer: ::Chat::ChatableUserSerializer, embed: :objects
has_one :user, embed: :objects
def user
object.user || Chat::NullUser.new
user = object.user || Chat::NullUser.new
Chat::BasicUserSerializer.new(user, root: false, scope: scope, include_status: true)
end
end
end

View File

@ -24,7 +24,6 @@
"name": { "type": "string" },
"avatar_template": { "type": "string" },
"username": { "type": "string" },
"custom_fields": { "type": ["object", "null"] },
"can_chat": { "type": "boolean" },
"has_chat_enabled": { "type": "boolean" }
}

View File

@ -64,7 +64,7 @@ RSpec.describe "Channel - Info - Members page", type: :system do
end
context "with user status" do
xit "renders status next to name" do
it "renders status next to name" do
SiteSetting.enable_user_status = true
current_user.set_status!("walking the dog", "dog")