feat: single chat export

This commit is contained in:
Timothy J. Baek committed 2024-06-02 21:39:09 -07:00
1 parent 13db33e947
commit fddf693dad
5 files changed
+75 -1

No files matched your search

+9
View File
@@ -298,6 +298,15 @@ class ChatTable:
# .limit(limit).offset(skip)
]
def get_archived_chats_by_user_id(self, user_id: str) -> List[ChatModel]:
return [
ChatModel(**model_to_dict(chat))
for chat in Chat.select()
.where(Chat.archived == True)
.where(Chat.user_id == user_id)
.order_by(Chat.updated_at.desc())
]
def delete_chat_by_id(self, id: str) -> bool:
try:
query = Chat.delete().where((Chat.id == id))