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:
@ -250,12 +250,10 @@ def rm():
|
||||
except Exception as e:
|
||||
errors += str(e)
|
||||
|
||||
|
||||
if errors: return server_error_response(e)
|
||||
return get_json_result(data=True)
|
||||
|
||||
|
||||
|
||||
@manager.route('/run', methods=['POST'])
|
||||
@login_required
|
||||
@validate_request("doc_ids", "run")
|
||||
@ -305,6 +303,11 @@ def rename():
|
||||
return get_data_error_result(
|
||||
retmsg="Database error (Document rename)!")
|
||||
|
||||
informs = File2DocumentService.get_by_document_id(req["doc_id"])
|
||||
if informs:
|
||||
e, file = FileService.get_by_id(informs[0].file_id)
|
||||
FileService.update_by_id(file.id, {"name": req["name"]})
|
||||
|
||||
return get_json_result(data=True)
|
||||
except Exception as e:
|
||||
return server_error_response(e)
|
||||
|
||||
Reference in New Issue
Block a user