feat(threads): add basic message thread API and web thread panel
All checks were successful
CI / test (push) Successful in 21s
All checks were successful
CI / test (push) Successful in 21s
This commit is contained in:
@@ -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,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user