feat/enh: show user count in channels

This commit is contained in:
Timothy Jaeryang Baek committed 2025-11-25 03:46:30 -05:00
1 parent a7ee36266a
commit 3b5710d0cd
4 files changed
+65 -5

No files matched your search

+3
View File
@@ -105,10 +105,13 @@ async def get_channel_by_id(id: str, user=Depends(get_verified_user)):
user.id, type="write", access_control=channel.access_control, strict=False
)
user_count = len(get_users_with_access("read", channel.access_control))
return ChannelResponse(
**{
**channel.model_dump(),
"write_access": write_access or user.role == "admin",
"user_count": user_count,
}
)