diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte index d01ae3de05..a98b76483d 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte @@ -47,7 +47,7 @@ let isValid = false - let sheets + let allSheets const saveDatasourceAndRedirect = async () => { try { @@ -85,14 +85,14 @@ } const info = await getDatasourceInfo(datasource) - sheets = info.tableNames + allSheets = info.tableNames - step = GoogleDatasouceConfigStep.SET_SHEETS - notifications.success( - checkConnection - ? "Connection Successful" - : `Datasource created successfully.` - ) + step = GoogleDatasouceConfigStep.SET_SHEETS + notifications.success( + checkConnection + ? "Connection Successful" + : `Datasource created successfully.` + ) // prevent the modal from closing return false @@ -101,7 +101,9 @@ [GoogleDatasouceConfigStep.SET_SHEETS]: { title: `Choose your sheets`, confirmButtonText: "Fetch sheets", - onConfirm: saveDatasourceAndRedirect, + onConfirm: async () => { + await saveDatasourceAndRedirect() + }, }, } @@ -147,6 +149,10 @@ {#if step === GoogleDatasouceConfigStep.SET_SHEETS} Select which spreadsheets you want to connect. + + {#each allSheets as sheet} + {sheet} + {/each} {/if}