From 6b2271040ddd37c1c510d068b583c62c6873be79 Mon Sep 17 00:00:00 2001 From: WatanabeToshimitsu Date: Fri, 29 Jul 2022 18:50:11 +0900 Subject: [PATCH] Do not delete database when occur error relating adding database --- src/components/organisms/DatabaseEditModal.tsx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/components/organisms/DatabaseEditModal.tsx b/src/components/organisms/DatabaseEditModal.tsx index 9958c05f..73ba6a09 100644 --- a/src/components/organisms/DatabaseEditModal.tsx +++ b/src/components/organisms/DatabaseEditModal.tsx @@ -212,16 +212,6 @@ export const DatabaseEditModal = ({ const onSubmit: SubmitHandler = async (requestBody) => { setIsSubmitting(true); - const procAfterFailAdd = async () => { - await fetchMetaStore( - getAccessToken, - metaStore.DatabaseService.deleteDatabase, - { - databaseId: requestBody.database_id, - } - ); - }; - const [saveDatabaseRes, saveDatabaseError] = !add && databaseId ? await fetchMetaStore( @@ -238,9 +228,6 @@ export const DatabaseEditModal = ({ ); if (saveDatabaseError) { - if (add) { - procAfterFailAdd(); - } enqueueErrorToastForFetchError( add ? "Failed to create new database" @@ -260,7 +247,6 @@ export const DatabaseEditModal = ({ { databaseId: createdDatabaseId } ); if (getConfigError) { - await procAfterFailAdd(); enqueueErrorToastForFetchError("Failed to get config", getConfigError); setIsSubmitting(false); return; @@ -272,7 +258,6 @@ export const DatabaseEditModal = ({ getConfigRes || {} ); if (initializeDatabaseError) { - await procAfterFailAdd(); enqueueErrorToastForFetchError( "Failed to initialize config for database", initializeDatabaseError