|
@@ -250,7 +250,7 @@ class ChatTable:
|
|
|
user_id: str,
|
|
|
include_archived: bool = False,
|
|
|
skip: int = 0,
|
|
|
- limit: int = 50,
|
|
|
+ limit: int = -1,
|
|
|
) -> List[ChatTitleIdResponse]:
|
|
|
with get_db() as db:
|
|
|
query = db.query(Chat).filter_by(user_id=user_id)
|
|
@@ -260,9 +260,10 @@ class ChatTable:
|
|
|
all_chats = (
|
|
|
query.order_by(Chat.updated_at.desc())
|
|
|
# limit cols
|
|
|
- .with_entities(
|
|
|
- Chat.id, Chat.title, Chat.updated_at, Chat.created_at
|
|
|
- ).all()
|
|
|
+ .with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at)
|
|
|
+ .limit(limit)
|
|
|
+ .offset(skip)
|
|
|
+ .all()
|
|
|
)
|
|
|
# result has to be destrctured from sqlalchemy `row` and mapped to a dict since the `ChatModel`is not the returned dataclass.
|
|
|
return [
|