feat: show user chats in admin panel

This commit is contained in:
Timothy J. Baek 2024-04-27 18:24:59 -04:00
parent 098ac18762
commit bcf78b4efa
8 changed files with 301 additions and 52 deletions

View file

@ -270,6 +270,15 @@ class ChatTable:
# .limit(limit).offset(skip)
]
def delete_chat_by_id(self, id: str) -> bool:
try:
query = Chat.delete().where((Chat.id == id))
query.execute() # Remove the rows, return number of rows removed.
return True and self.delete_shared_chat_by_chat_id(id)
except:
return False
def delete_chat_by_id_and_user_id(self, id: str, user_id: str) -> bool:
try:
query = Chat.delete().where((Chat.id == id) & (Chat.user_id == user_id))