chore: delete user backend refac

This commit is contained in:
Timothy J. Baek 2023-12-28 23:17:58 -08:00
parent 7fade0bb2f
commit 48cc2c5053
2 changed files with 17 additions and 6 deletions

View file

@ -153,5 +153,14 @@ class ChatTable:
except:
return False
def delete_chats_by_user_id(self, user_id: str) -> bool:
try:
query = Chat.delete().where(Chat.user_id == user_id)
query.execute() # Remove the rows, return number of rows removed.
return True
except:
return False
Chats = ChatTable(DB)