You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2022/09/22 15:12:07 UTC

[incubator-devlake] branch main updated: fix: add missing async wrapper for db migration (#3110)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new be472348 fix: add missing async wrapper for db migration (#3110)
be472348 is described below

commit be4723487c6a08ede74eeebab6013caf873edce5
Author: Julien Chinapen <ju...@merico.dev>
AuthorDate: Thu Sep 22 11:12:02 2022 -0400

    fix: add missing async wrapper for db migration (#3110)
---
 config-ui/src/hooks/useDatabaseMigrations.jsx | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/config-ui/src/hooks/useDatabaseMigrations.jsx b/config-ui/src/hooks/useDatabaseMigrations.jsx
index 6eb09976..a545de37 100644
--- a/config-ui/src/hooks/useDatabaseMigrations.jsx
+++ b/config-ui/src/hooks/useDatabaseMigrations.jsx
@@ -33,12 +33,15 @@ function useDatabaseMigrations(Configuration = MigrationOptions) {
 
   const handleConfirmMigration = useCallback(() => {
     setIsProcessing(true)
-    const m = request.get(Configuration.apiProceedEndpoint)
-    setWasMigrationSuccessful(m?.status === 200 && m?.success === true)
-    setTimeout(() => {
-      setIsProcessing(false)
-      setHasMigrationFailed(m?.status !== 200)
-    }, 3000)
+    const migrate = async () => {
+      const m = await request.get(Configuration.apiProceedEndpoint)
+      setWasMigrationSuccessful(m?.status === 200 && m?.data?.success === true)
+      setTimeout(() => {
+        setIsProcessing(false)
+        setHasMigrationFailed(m?.status !== 200)
+      }, 3000)
+    }
+    migrate()
   }, [Configuration.apiProceedEndpoint])
 
   const handleCancelMigration = useCallback(() => {