diff --git a/optuna_dashboard/_app.py b/optuna_dashboard/_app.py index 1baf76fe..4c22bdbf 100644 --- a/optuna_dashboard/_app.py +++ b/optuna_dashboard/_app.py @@ -312,7 +312,7 @@ def create_app( @app.put("/api/studies//preference_feedback_component_type") @json_api_view - def put_component(study_id: int) -> dict[str, Any]: + def put_preference_feedback_component_type(study_id: int) -> dict[str, Any]: try: component_type = request.json.get("type", "") artifact_key = request.json.get("artifact_key", None) @@ -329,6 +329,8 @@ def create_app( component_type=component_type, artifact_key=artifact_key, ) + response.status = 204 + return {} @app.delete("/api/studies//preference/") @json_api_view diff --git a/optuna_dashboard/_serializer.py b/optuna_dashboard/_serializer.py index ea22644f..b229b738 100644 --- a/optuna_dashboard/_serializer.py +++ b/optuna_dashboard/_serializer.py @@ -168,7 +168,6 @@ def serialize_study_detail( serialized["feedback_component_type"] = system_attrs.get( _SYSTEM_ATTR_FEEDBACK_COMPONENT, {} ) - if serialized["is_preferential"]: serialized["preference_history"] = serialize_preference_history(system_attrs) serialized["preferences"] = get_preferences(system_attrs) serialized["plotly_graph_objects"] = [