mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-17 12:30:35 +08:00
Add removeAssociatedArtifact arg
This commit is contained in:
@@ -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})`, {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user