Ver código fonte

Add support for folder deletion (#3635)

### What problem does this PR solve?

Add support for folder deletion.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
tags/v0.14.0
liuhua 11 meses atrás
pai
commit
d8b150a34c
Nenhuma conta vinculada ao e-mail do autor do commit
2 arquivos alterados com 3 adições e 0 exclusões
  1. 1
    0
      api/apps/kb_app.py
  2. 2
    0
      api/apps/sdk/dataset.py

+ 1
- 0
api/apps/kb_app.py Ver arquivo

@@ -162,6 +162,7 @@ def rm():
message="Database error (Document removal)!")
f2d = File2DocumentService.get_by_document_id(doc.id)
FileService.filter_delete([File.source_type == FileSource.KNOWLEDGEBASE, File.id == f2d[0].file_id])
FileService.filter_delete([File.source_type == FileSource.KNOWLEDGEBASE, File.type == "folder", File.name == kbs[0].name])
File2DocumentService.delete_by_document_id(doc.id)

if not KnowledgebaseService.delete_by_id(req["kb_id"]):

+ 2
- 0
api/apps/sdk/dataset.py Ver arquivo

@@ -252,6 +252,8 @@ def delete(tenant_id):
File.id == f2d[0].file_id,
]
)
FileService.filter_delete(
[File.source_type == FileSource.KNOWLEDGEBASE, File.type == "folder", File.name == kbs[0].name])
File2DocumentService.delete_by_document_id(doc.id)
if not KnowledgebaseService.delete_by_id(id):
return get_error_data_result(message="Delete dataset error.(Database error)")

Carregando…
Cancelar
Salvar