fix by review

This commit is contained in:
moririn2528
2023-09-15 18:06:53 +09:00
parent 9093f845fa
commit 3d1e7f1df8
3 changed files with 5 additions and 8 deletions
+2 -2
View File
@@ -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)
+2 -5
View File
@@ -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
+1 -1
View File
@@ -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",