fix: cleanup unused tags

This commit is contained in:
Timothy J. Baek 2024-02-25 13:03:26 -08:00
parent 7c1b8e396a
commit 1d937ec2f2
4 changed files with 37 additions and 6 deletions

View file

@ -115,9 +115,12 @@ async def get_user_chats_by_tag_name(
for chat_id_tag in Tags.get_chat_ids_by_tag_name_and_user_id(tag_name, user.id)
]
print(chat_ids)
chats = Chats.get_chat_lists_by_chat_ids(chat_ids, skip, limit)
return Chats.get_chat_lists_by_chat_ids(chat_ids, skip, limit)
if len(chats) == 0:
Tags.delete_tag_by_tag_name_and_user_id(tag_name, user.id)
return chats
############################