mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-07-02 18:22:23 +00:00
small update in delete
This commit is contained in:
parent
cafc9eb8a8
commit
5c92f23e6a
@ -151,6 +151,7 @@ def delete_file(
|
|||||||
for doc_id in doc_ids:
|
for doc_id in doc_ids:
|
||||||
service.delete(doc_id)
|
service.delete(doc_id)
|
||||||
document = crud.documents.get_by_filename(db,file_name=filename)
|
document = crud.documents.get_by_filename(db,file_name=filename)
|
||||||
|
if document:
|
||||||
crud.documents.remove(db=db, id=document.id)
|
crud.documents.remove(db=db, id=document.id)
|
||||||
return {"status": "SUCCESS", "message": f"{filename}' successfully deleted."}
|
return {"status": "SUCCESS", "message": f"{filename}' successfully deleted."}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user