Fix invalid schemas while fetching

This commit is contained in:
Adria Navarro 2024-10-14 13:00:26 +02:00
parent b125a7c599
commit 1052f36084
1 changed files with 6 additions and 0 deletions

View File

@ -20,7 +20,13 @@ export async function processTable(table: Table): Promise<Table> {
if (!table) { if (!table) {
return table return table
} }
table = { ...table }
if (table._id && isExternalTableID(table._id)) { if (table._id && isExternalTableID(table._id)) {
// Old created external tables via Budibase might have a missing field name breaking some UI such as filters
if (table.schema["id"] && !table.schema["id"].name) {
table.schema["id"].name = "id"
}
return { return {
...table, ...table,
type: "table", type: "table",