feat(threads): add basic message thread API and web thread panel
All checks were successful
CI / test (push) Successful in 21s

This commit is contained in:
2026-03-08 13:37:53 +03:00
parent cf1a77ae76
commit c6e8b779b0
7 changed files with 145 additions and 1 deletions

View File

@@ -177,6 +177,20 @@ async def search_messages(
)
async def get_message_thread(
db: AsyncSession,
*,
message_id: int,
user_id: int,
limit: int = 100,
) -> list[Message]:
root = await repository.get_message_by_id(db, message_id)
if not root:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Message not found")
await ensure_chat_membership(db, chat_id=root.chat_id, user_id=user_id)
return await repository.list_message_thread(db, root_message_id=message_id, user_id=user_id, limit=limit)
async def update_message(
db: AsyncSession,
*,