Fixing issues with retrieval.

This commit is contained in:
mike12345567 2024-11-26 12:03:13 +00:00
parent f8e766823c
commit b75e2e85c6
2 changed files with 10 additions and 8 deletions

View File

@ -162,9 +162,12 @@ export async function finaliseRow(
})
}
const response = await db.put(row)
// for response, calculate the formulas for the enriched row
enrichedRow._rev = response.rev
await db.put(row)
const retrieved = await db.tryGet<Row>(row._id)
enrichedRow = {
...enrichedRow,
...retrieved,
}
enrichedRow = await processFormulas(table, enrichedRow, {
dynamic: false,
})

View File

@ -204,12 +204,11 @@ export async function inputProcessing(
for (const [key, value] of Object.entries(clonedRow)) {
const field = table.schema[key]
const isBuiltinColumn = isExternalTableID(table._id!)
? isExternalColumnName(key)
: isInternalColumnName(key)
// cleanse fields that aren't in the schema
if (
!field && isExternalTableID(table._id!)
? !isExternalColumnName(key)
: !isInternalColumnName(key)
) {
if (!field && !isBuiltinColumn) {
delete clonedRow[key]
}
// field isn't found - might be a built-in column, skip over it