mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
fix by review
This commit is contained in:
@@ -316,9 +316,9 @@ def create_app(
|
||||
response.status = 204
|
||||
return {}
|
||||
|
||||
@app.put("/api/studies/<study_id:int>/preference_feedback_component_type")
|
||||
@app.put("/api/studies/<study_id:int>/preference_feedback_component")
|
||||
@json_api_view
|
||||
def put_preference_feedback_component_type(study_id: int) -> dict[str, Any]:
|
||||
def put_preference_feedback_component(study_id: int) -> dict[str, Any]:
|
||||
try:
|
||||
component_type = request.json.get("type", "")
|
||||
artifact_key = request.json.get("artifact_key", None)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Feedback } from "@mui/icons-material"
|
||||
import axios from "axios"
|
||||
|
||||
const axiosInstance = axios.create({ baseURL: API_ENDPOINT })
|
||||
@@ -388,10 +387,8 @@ export const reportFeedbackComponentAPI = (
|
||||
): Promise<void> => {
|
||||
return axiosInstance
|
||||
.put<void>(
|
||||
`/api/studies/${studyId}/preference_feedback_component_type`,
|
||||
component_type.output_type === "note"
|
||||
? { type: "note" }
|
||||
: { type: "artifact", artifact_key: component_type.artifact_key }
|
||||
`/api/studies/${studyId}/preference_feedback_component`,
|
||||
component_type
|
||||
)
|
||||
.then(() => {
|
||||
return
|
||||
|
||||
@@ -195,7 +195,7 @@ class APITestCase(TestCase):
|
||||
study_id = study._study._study_id
|
||||
status, _, _ = send_request(
|
||||
app,
|
||||
f"/api/studies/{study_id}/preference_feedback_component_type",
|
||||
f"/api/studies/{study_id}/preference_feedback_component",
|
||||
"PUT",
|
||||
body=json.dumps({"type": "artifact", "artifact_key": "image"}),
|
||||
content_type="application/json",
|
||||
|
||||
Reference in New Issue
Block a user