feat/enh: move chats in folder on delete

Co-Authored-By: expruc <25387342+expruc@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-11-23 00:01:49 -05:00
co-authored by expruc
parent b2034861ae
commit e6951e804a
5 changed files with 76 additions and 26 deletions
+14
View File
@@ -1142,6 +1142,20 @@ class ChatTable:
except Exception:
return False
def move_chats_by_user_id_and_folder_id(
self, user_id: str, folder_id: str, new_folder_id: Optional[str]
) -> bool:
try:
with get_db() as db:
db.query(Chat).filter_by(user_id=user_id, folder_id=folder_id).update(
{"folder_id": new_folder_id}
)
db.commit()
return True
except Exception:
return False
def delete_shared_chats_by_user_id(self, user_id: str) -> bool:
try:
with get_db() as db: