Fix sql calculations
This commit is contained in:
parent
7932ee7620
commit
499d3f2041
|
@ -169,20 +169,22 @@ export async function buildSqlFieldList(
|
||||||
fields = Object.keys(helpers.views.basicFields(source))
|
fields = Object.keys(helpers.views.basicFields(source))
|
||||||
.filter(f => table.schema[f].type !== FieldType.LINK)
|
.filter(f => table.schema[f].type !== FieldType.LINK)
|
||||||
.map(c => `${table.name}.${c}`)
|
.map(c => `${table.name}.${c}`)
|
||||||
|
|
||||||
|
if (!helpers.views.isCalculationView(source)) {
|
||||||
|
fields.push(
|
||||||
|
...getRequiredFields(
|
||||||
|
{
|
||||||
|
...table,
|
||||||
|
primaryDisplay: source.primaryDisplay || table.primaryDisplay,
|
||||||
|
},
|
||||||
|
fields
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fields = extractRealFields(source)
|
fields = extractRealFields(source)
|
||||||
}
|
}
|
||||||
|
|
||||||
fields.push(
|
|
||||||
...getRequiredFields(
|
|
||||||
{
|
|
||||||
...table,
|
|
||||||
primaryDisplay: source.primaryDisplay || table.primaryDisplay,
|
|
||||||
},
|
|
||||||
fields
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
for (const field of Object.values(table.schema)) {
|
for (const field of Object.values(table.schema)) {
|
||||||
if (field.type !== FieldType.LINK || !relationships || !field.tableId) {
|
if (field.type !== FieldType.LINK || !relationships || !field.tableId) {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue