DocuRAG / Api /app /modules /documentHandeler /features /deleteDocument_feature.py
abadesalex's picture
Update to Qdrant db
47b5f0c
raw
history blame
629 Bytes
from app.infrastructure.repository.document_handeler_repository import (
DocumentHandelerRepository,
)
class DeleteDocumentFeature:
def __init__(self, update_document_repository: DocumentHandelerRepository):
self.update_document_repository = update_document_repository
async def delete_document_by_filename(self, document_name: str) -> bool:
document = self.update_document_repository.find_points_by_document_name(
document_name
)
if document is None:
return False
self.update_document_repository.delete_document_by_id(document)
return True