Add removeAssociatedArtifact arg

This commit is contained in:
porink0424
2024-05-31 15:10:35 +09:00
parent a6c7bfd437
commit a6f608310f
3 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -284,9 +284,9 @@ export const actionCreator = () => {
})
}
const deleteStudy = (studyId: number) => {
const deleteStudy = (studyId: number, removeAssociatedArtifacts: boolean) => {
apiClient
.deleteStudy(studyId)
.deleteStudy(studyId, removeAssociatedArtifacts)
.then(() => {
setStudySummaries(studySummaries.filter((s) => s.study_id !== studyId))
enqueueSnackbar(`Success to delete a study (id=${studyId})`, {
+4 -1
View File
@@ -185,7 +185,10 @@ export abstract class APIClient {
studyName: string,
directions: Optuna.StudyDirection[]
): Promise<StudySummary>
abstract deleteStudy(studyId: number): Promise<void>
abstract deleteStudy(
studyId: number,
removeAssociatedArtifacts: boolean
): Promise<void>
abstract renameStudy(
studyId: number,
studyName: string
+11 -4
View File
@@ -116,10 +116,17 @@ export class AxiosClient extends APIClient {
: undefined,
}
})
deleteStudy = (studyId: number): Promise<void> =>
this.axiosInstance.delete(`/api/studies/${studyId}`).then(() => {
return
})
deleteStudy = (
studyId: number,
removeAssociatedArtifacts: boolean
): Promise<void> =>
this.axiosInstance
.delete(
`/api/studies/${studyId}?remove_associated_artifacts=${removeAssociatedArtifacts}`
)
.then(() => {
return
})
renameStudy = (studyId: number, studyName: string): Promise<StudySummary> =>
this.axiosInstance
.post<RenameStudyResponse>(`/api/studies/${studyId}/rename`, {