From 0b75f6036d764ece793b97ca7da3aa6e9395c4b8 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 15 Nov 2022 12:18:04 +0000 Subject: [PATCH] Fix to ensure an appropriate internal source is selected when creating an internal table --- .../TableNavigator/modals/CreateTableModal.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index 6846c3d8d8..44e592a0b1 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -15,7 +15,14 @@ import { buildAutoColumn, getAutoColumnInformation } from "builderStore/utils" $: tableNames = $tables.list.map(table => table.name) - $: targetDatasourceId = $datasources.selected + $: selectedSource = $datasources.list.find( + source => source._id === $datasources.selected + ) + + $: isSelectedInternal = selectedSource?.type === "budibase" + $: targetDatasourceId = isSelectedInternal + ? selectedSource._id + : "bb_internal" export let name let dataImport