refac: folder delete logic

This commit is contained in:
Timothy Jaeryang Baek
2025-09-24 09:04:54 -05:00
parent 91a9f32904
commit b8086c5edf
2 changed files with 18 additions and 8 deletions

View File

@@ -943,6 +943,16 @@ class ChatTable:
return count
def count_chats_by_folder_id_and_user_id(self, folder_id: str, user_id: str) -> int:
with get_db() as db:
query = db.query(Chat).filter_by(user_id=user_id)
query = query.filter_by(folder_id=folder_id)
count = query.count()
log.info(f"Count of chats for folder '{folder_id}': {count}")
return count
def delete_tag_by_id_and_user_id_and_tag_name(
self, id: str, user_id: str, tag_name: str
) -> bool: