mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-29 04:08:12 +08:00
Refactor: Doc batch change status (#14337)
### What problem does this PR solve? Before migration Web API: POST /v1/document/change_status After consolidation, Restful API POST /api/v1/datasets/<dataset_id>/documents/batch-update-status ### Type of change - [x] Refactoring
This commit is contained in:
@@ -438,8 +438,16 @@ def document_update_metadata_setting(auth, dataset_id, doc_id, payload=None, *,
|
||||
return res.json()
|
||||
|
||||
|
||||
def document_change_status(auth, payload=None, *, headers=HEADERS, data=None):
|
||||
res = requests.post(url=f"{HOST_ADDRESS}{DOCUMENT_APP_URL}/change_status", headers=headers, auth=auth, json=payload, data=data)
|
||||
def document_change_status(auth, dataset_id, payload=None, *, headers=HEADERS, data=None):
|
||||
"""
|
||||
Batch update document status within a dataset.
|
||||
|
||||
Args:
|
||||
auth: Authentication credentials
|
||||
dataset_id: ID of the dataset
|
||||
payload: Request body containing doc_ids and status
|
||||
"""
|
||||
res = requests.post(url=f"{HOST_ADDRESS}{DATASETS_URL}/{dataset_id}/documents/batch-update-status", headers=headers, auth=auth, json=payload, data=data)
|
||||
return res.json()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user