feat(ui): show total archived chat count in ChatsModal title (#25872)

This commit is contained in:
G30
2026-06-17 02:57:27 +02:00
committed by GitHub
parent e031fadc35
commit dee07d8a30
5 changed files with 75 additions and 3 deletions
+11
View File
@@ -831,6 +831,17 @@ class ChatTable:
for chat in all_chats
]
async def count_archived_chats_by_user_id(
self,
user_id: str,
db: AsyncSession | None = None,
) -> int:
async with get_async_db_context(db) as session:
result = await session.execute(
select(func.count(Chat.id)).filter_by(user_id=user_id, archived=True)
)
return result.scalar() or 0
async def get_shared_chat_list_by_user_id(
self,
user_id: str,
+13
View File
@@ -819,6 +819,19 @@ async def get_archived_session_user_chat_list(
)
############################
# GetArchivedChatsCount
############################
@router.get('/archived/count', response_model=int)
async def get_archived_session_user_chat_count(
user=Depends(get_verified_user),
db: AsyncSession = Depends(get_async_session),
):
return await Chats.count_archived_chats_by_user_id(user.id, db=db)
############################
# ArchiveAllChats
############################