Enable table to know when invalid column names have been passed
This commit is contained in:
parent
f84302ed89
commit
3c67e4806e
|
@ -77,9 +77,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFields = (schema, customColumns, showAutoColumns) => {
|
const getFields = (schema, customColumns, showAutoColumns) => {
|
||||||
if (customColumns?.length) {
|
// Check for an invalid column selection
|
||||||
|
let invalid = false
|
||||||
|
customColumns?.forEach(column => {
|
||||||
|
if (schema[column] == null) {
|
||||||
|
invalid = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Use column selection if it exists
|
||||||
|
if (!invalid && customColumns?.length) {
|
||||||
return customColumns
|
return customColumns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Otherwise generate columns
|
||||||
let columns = []
|
let columns = []
|
||||||
let autoColumns = []
|
let autoColumns = []
|
||||||
Object.entries(schema).forEach(([field, fieldSchema]) => {
|
Object.entries(schema).forEach(([field, fieldSchema]) => {
|
||||||
|
|
Loading…
Reference in New Issue