refactor: simplify success response in dataset API endpoints by returning status code 204 directly (#19685)

This commit is contained in:
GuanMu 2025-05-14 18:44:35 +08:00 • committed by GitHub
commit 17b929124f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -313,7 +313,7 @@ class DatasetApi(DatasetApiResource):
try:
if DatasetService.delete_dataset(dataset_id_str, current_user):
DatasetPermissionService.clear_partial_member_list(dataset_id_str)
return {"result": "success"}, 204
return 204
else:
raise NotFound("Dataset not found.")
except services.errors.dataset.DatasetInUseError: