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:
parent
d73105dbee
commit
69ec82856c
|
@ -52,7 +52,6 @@
|
||||||
.map(query => ({
|
.map(query => ({
|
||||||
label: query.name,
|
label: query.name,
|
||||||
name: query.name,
|
name: query.name,
|
||||||
tableId: query._id,
|
|
||||||
...query,
|
...query,
|
||||||
type: "query",
|
type: "query",
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
function getOptions(ds, dsSchema) {
|
function getOptions(ds, dsSchema) {
|
||||||
let base = Object.values(dsSchema)
|
let base = Object.values(dsSchema)
|
||||||
if (!ds?.tableId) {
|
if (!ds?.tableId) {
|
||||||
return base
|
return base.map(field => field.name)
|
||||||
}
|
}
|
||||||
const currentTable = $tables.list.find(table => table._id === ds.tableId)
|
const currentTable = $tables.list.find(table => table._id === ds.tableId)
|
||||||
return getFields(base, { allowLinks: currentTable?.sql }).map(
|
return getFields(base, { allowLinks: currentTable?.sql }).map(
|
||||||
|
|
Loading…
Reference in New Issue