revert: export chats to include archived chats

This commit is contained in:
Timothy J. Baek 2024-04-20 19:24:58 -05:00
parent 2fd2f792d6
commit 74dd9b561a

View file

@ -230,16 +230,13 @@ class ChatTable:
def get_all_chats(self) -> List[ChatModel]:
return [
ChatModel(**model_to_dict(chat))
for chat in Chat.select()
.where(Chat.archived == False)
.order_by(Chat.updated_at.desc())
for chat in Chat.select().order_by(Chat.updated_at.desc())
]
def get_all_chats_by_user_id(self, user_id: str) -> List[ChatModel]:
return [
ChatModel(**model_to_dict(chat))
for chat in Chat.select()
.where(Chat.archived == False)
.where(Chat.user_id == user_id)
.order_by(Chat.updated_at.desc())
]