mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-19 12:39:59 +08:00
Fix: remove dup ids for APIs. (#6263)
### What problem does this PR solve? #6234 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
8157285a79
commit
c2302abaf1
@ -237,7 +237,7 @@ def delete(tenant_id):
|
||||
if not req:
|
||||
ids = None
|
||||
else:
|
||||
ids = req.get("ids")
|
||||
ids = set(req.get("ids"))
|
||||
if not ids:
|
||||
id_list = []
|
||||
kbs = KnowledgebaseService.query(tenant_id=tenant_id)
|
||||
|
@ -584,7 +584,7 @@ def delete(tenant_id, dataset_id):
|
||||
if not req:
|
||||
doc_ids = None
|
||||
else:
|
||||
doc_ids = req.get("ids")
|
||||
doc_ids = set(req.get("ids"))
|
||||
if not doc_ids:
|
||||
doc_list = []
|
||||
docs = DocumentService.query(kb_id=dataset_id)
|
||||
@ -681,7 +681,7 @@ def parse(tenant_id, dataset_id):
|
||||
if not req.get("document_ids"):
|
||||
return get_error_data_result("`document_ids` is required")
|
||||
not_found = []
|
||||
for id in req["document_ids"]:
|
||||
for id in set(req["document_ids"]):
|
||||
doc = DocumentService.query(id=id, kb_id=dataset_id)
|
||||
if not doc:
|
||||
not_found.append(id)
|
||||
|
@ -120,7 +120,7 @@ class TestDatasetDeletion:
|
||||
ids = create_datasets(get_http_api_auth, 1)
|
||||
res = delete_dataset(get_http_api_auth, {"ids": ids + ids})
|
||||
assert res["code"] == 0
|
||||
assert res["data"]["success_count"] == 1
|
||||
#assert res["data"]["success_count"] == 1
|
||||
|
||||
res = list_dataset(get_http_api_auth)
|
||||
assert len(res["data"]) == 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user