From 3bb98348957dd978ff63f965508f220cda9d96cd Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 12 Apr 2022 16:58:26 +0100 Subject: [PATCH] Remove table ID from custom queries to fix 500 errors when trying to fetch a table definition and passing up a query ID, and fix issue with search fields when no table ID exists --- .../PropertiesPanel/PropertyControls/DataSourceSelect.svelte | 1 - .../PropertiesPanel/PropertyControls/SearchFieldSelect.svelte | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte index 73554b45db..1e19508744 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte @@ -52,7 +52,6 @@ .map(query => ({ label: query.name, name: query.name, - tableId: query._id, ...query, type: "query", })) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte index e609426b1e..41906d3ba1 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte @@ -22,7 +22,7 @@ function getOptions(ds, dsSchema) { let base = Object.values(dsSchema) if (!ds?.tableId) { - return base + return base.map(field => field.name) } const currentTable = $tables.list.find(table => table._id === ds.tableId) return getFields(base, { allowLinks: currentTable?.sql }).map(