feat: add search APIs and telegram-like chats sidebar flow
All checks were successful
CI / test (push) Successful in 24s
All checks were successful
CI / test (push) Successful in 24s
- implement chat query filtering and message search endpoints - add db indexes for search fields - activate chats search input in web - replace inline create panel with floating TG-style action menu
This commit is contained in:
@@ -47,9 +47,16 @@ async def create_chat_for_user(db: AsyncSession, *, creator_id: int, payload: Ch
|
||||
return chat
|
||||
|
||||
|
||||
async def get_chats_for_user(db: AsyncSession, *, user_id: int, limit: int = 50, before_id: int | None = None) -> list[Chat]:
|
||||
async def get_chats_for_user(
|
||||
db: AsyncSession,
|
||||
*,
|
||||
user_id: int,
|
||||
limit: int = 50,
|
||||
before_id: int | None = None,
|
||||
query: str | None = None,
|
||||
) -> list[Chat]:
|
||||
safe_limit = max(1, min(limit, 100))
|
||||
return await repository.list_user_chats(db, user_id=user_id, limit=safe_limit, before_id=before_id)
|
||||
return await repository.list_user_chats(db, user_id=user_id, limit=safe_limit, before_id=before_id, query=query)
|
||||
|
||||
|
||||
async def get_chat_for_user(db: AsyncSession, *, chat_id: int, user_id: int) -> tuple[Chat, list]:
|
||||
|
||||
Reference in New Issue
Block a user