mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 19:37:47 +01:00
fix: collapsible space toggle issue
This commit is contained in:
@@ -215,7 +215,18 @@ async def delete_folder_by_id(id: str, user=Depends(get_verified_user)):
|
||||
if folder:
|
||||
try:
|
||||
result = Folders.delete_folder_by_id_and_user_id(id, user.id)
|
||||
return result
|
||||
if result:
|
||||
# Delete all chats in the folder
|
||||
chats = Chats.get_chats_by_folder_id_and_user_id(id, user.id)
|
||||
for chat in chats:
|
||||
Chats.delete_chat_by_id(chat.id, user.id)
|
||||
|
||||
return result
|
||||
else:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=ERROR_MESSAGES.DEFAULT("Error deleting folder"),
|
||||
)
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
log.error(f"Error deleting folder: {id}")
|
||||
|
||||
Reference in New Issue
Block a user