Fix: DataSet.update() now refreshes object data (#8058)

### What problem does this PR solve?

#8057 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Liu An
2025-06-05 09:26:19 +08:00
committed by GitHub
parent ec60b322ab
commit ab5e3ded68
3 changed files with 25 additions and 14 deletions

View File

@ -385,7 +385,16 @@ def update(tenant_id, dataset_id):
logging.exception(e)
return get_error_data_result(message="Database operation failed")
return get_result()
try:
ok, k = KnowledgebaseService.get_by_id(kb.id)
if not ok:
return get_error_data_result(message="Dataset created failed")
except OperationalError as e:
logging.exception(e)
return get_error_data_result(message="Database operation failed")
response_data = remap_dictionary_keys(k.to_dict())
return get_result(data=response_data)
@manager.route("/datasets", methods=["GET"]) # noqa: F821