Skip to content

Commit

Permalink
Fix sql calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
adrinr committed Dec 17, 2024
1 parent 51d8617 commit 9852ba9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/server/src/api/controllers/row/utils/sqlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,22 @@ export async function buildSqlFieldList(
fields = Object.keys(helpers.views.basicFields(source))
.filter(f => table.schema[f].type !== FieldType.LINK)
.map(c => `${table.name}.${c}`)

if (!helpers.views.isCalculationView(source)) {
fields.push(
...getRequiredFields(
{
...table,
primaryDisplay: source.primaryDisplay || table.primaryDisplay,
},
fields
)
)
}
} else {
fields = extractRealFields(source)
}

fields.push(
...getRequiredFields(
{
...table,
primaryDisplay: source.primaryDisplay || table.primaryDisplay,
},
fields
)
)

for (const field of Object.values(table.schema)) {
if (field.type !== FieldType.LINK || !relationships || !field.tableId) {
continue
Expand Down

0 comments on commit 9852ba9

Please sign in to comment.