mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix rename bug (#562)
### What problem does this PR solve? fix rename file bugs ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -312,6 +312,13 @@ def rename():
|
||||
return get_data_error_result(
|
||||
retmsg="Database error (File rename)!")
|
||||
|
||||
informs = File2DocumentService.get_by_file_id(req["file_id"])
|
||||
if informs:
|
||||
if not DocumentService.update_by_id(
|
||||
informs[0].document_id, {"name": req["name"]}):
|
||||
return get_data_error_result(
|
||||
retmsg="Database error (Document rename)!")
|
||||
|
||||
return get_json_result(data=True)
|
||||
except Exception as e:
|
||||
return server_error_response(e)
|
||||
|
||||
Reference in New Issue
Block a user