accounting for false values in row processing

This commit is contained in:
Martin McKeaveney 2022-04-28 23:57:33 +01:00
parent 4bab24f1ac
commit 64de5e301e
1 changed files with 3 additions and 2 deletions

View File

@ -175,9 +175,10 @@ module External {
const thisRow: Row = {} const thisRow: Row = {}
// filter the row down to what is actually the row (not joined) // filter the row down to what is actually the row (not joined)
for (let fieldName of Object.keys(table.schema)) { for (let fieldName of Object.keys(table.schema)) {
const value = row[`${table.name}.${fieldName}`] || row[fieldName] const pathValue = row[`${table.name}.${fieldName}`]
const value = pathValue != null ? pathValue : row[fieldName]
// all responses include "select col as table.col" so that overlaps are handled // all responses include "select col as table.col" so that overlaps are handled
if (value) { if (value != null) {
thisRow[fieldName] = value thisRow[fieldName] = value
} }
} }