mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Implement API client for note
This commit is contained in:
@@ -45,6 +45,10 @@ interface StudyDetailResponse {
|
||||
intersection_search_space: SearchSpace[]
|
||||
union_search_space: SearchSpace[]
|
||||
has_intermediate_values: boolean
|
||||
note: {
|
||||
version: number
|
||||
body: string
|
||||
}
|
||||
}
|
||||
|
||||
export const getStudyDetailAPI = (
|
||||
@@ -62,6 +66,7 @@ export const getStudyDetailAPI = (
|
||||
return convertTrialResponse(trial)
|
||||
})
|
||||
return {
|
||||
id: studyId,
|
||||
name: res.data.name,
|
||||
datetime_start: new Date(res.data.datetime_start),
|
||||
directions: res.data.directions,
|
||||
@@ -72,6 +77,7 @@ export const getStudyDetailAPI = (
|
||||
union_search_space: res.data.union_search_space,
|
||||
intersection_search_space: res.data.intersection_search_space,
|
||||
has_intermediate_values: res.data.has_intermediate_values,
|
||||
note: res.data.note,
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -178,6 +184,17 @@ export const deleteStudyAPI = (studyId: number) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const saveNoteAPI = (
|
||||
studyId: number,
|
||||
note: { version: number; body: string }
|
||||
): Promise<void> => {
|
||||
return axiosInstance
|
||||
.post<void>(`/api/studies/${studyId}/note`, note)
|
||||
.then((res) => {
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
interface ParamImportancesResponse {
|
||||
target_name: string
|
||||
param_importances: ParamImportance[]
|
||||
|
||||
+7
@@ -45,6 +45,11 @@ declare interface Attribute {
|
||||
value: string
|
||||
}
|
||||
|
||||
declare interface Note {
|
||||
version: number
|
||||
body: string
|
||||
}
|
||||
|
||||
declare interface Trial {
|
||||
trial_id: number
|
||||
study_id: number
|
||||
@@ -70,6 +75,7 @@ declare interface StudySummary {
|
||||
}
|
||||
|
||||
declare interface StudyDetail {
|
||||
id: number
|
||||
name: string
|
||||
directions: StudyDirection[]
|
||||
datetime_start: Date
|
||||
@@ -78,6 +84,7 @@ declare interface StudyDetail {
|
||||
intersection_search_space: SearchSpace[]
|
||||
union_search_space: SearchSpace[]
|
||||
has_intermediate_values: boolean
|
||||
note: Note
|
||||
}
|
||||
|
||||
declare interface StudyDetails {
|
||||
|
||||
Reference in New Issue
Block a user