mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Refactor: Change update doc from PUT to patch (#14067)
### What problem does this PR solve? Before change, update_document in api/apps/restful_apis/document_api.py is using "PUT". After change, it will use "PATCH" which is more suitable. ### Type of change - [x] Refactoring
This commit is contained in:
@@ -54,7 +54,7 @@ class Document(Base):
|
||||
if "meta_fields" in update_message:
|
||||
if not isinstance(update_message["meta_fields"], dict):
|
||||
raise Exception("meta_fields must be a dictionary")
|
||||
res = self.put(f"/datasets/{self.dataset_id}/documents/{self.id}", update_message)
|
||||
res = self.patch(f"/datasets/{self.dataset_id}/documents/{self.id}", update_message)
|
||||
res = res.json()
|
||||
if res.get("code") != 0:
|
||||
raise Exception(res["message"])
|
||||
|
||||
Reference in New Issue
Block a user