backend fixes
This commit is contained in:
parent
36a55930f9
commit
aabb63f947
4 changed files with 11 additions and 6 deletions
|
|
@ -214,7 +214,8 @@ async def list_threads(
|
|||
}
|
||||
}
|
||||
)
|
||||
rows = [row async for row in database.mailbox_entries.aggregate(pipeline)]
|
||||
cursor = await database.mailbox_entries.aggregate(pipeline)
|
||||
rows = [row async for row in cursor]
|
||||
has_more = len(rows) > limit
|
||||
rows = rows[:limit]
|
||||
items = [thread_summary_from_group(row, mailbox) for row in rows]
|
||||
|
|
@ -298,7 +299,8 @@ async def get_thread(
|
|||
},
|
||||
{"$unwind": "$message"},
|
||||
]
|
||||
rows = [row async for row in database.mailbox_entries.aggregate(pipeline)]
|
||||
cursor = await database.mailbox_entries.aggregate(pipeline)
|
||||
rows = [row async for row in cursor]
|
||||
if not rows:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Thread not found.")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue