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

This commit is contained in:
Andrew Kingston 2022-04-12 16:58:26 +01:00
parent 57d1d9c2d5
commit c9d0791a0e
2 changed files with 1 additions and 2 deletions

View File

@ -52,7 +52,6 @@
.map(query => ({
label: query.name,
name: query.name,
tableId: query._id,
...query,
type: "query",
}))

View File

@ -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(