(core) API fix for a bug that treated 0 as null

Summary: Bug with 'records' endpoint that was treating 0 as null.

Test Plan: Modified tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3262
pull/131/head
Jarosław Sadziński 2 years ago
parent 7cc3092e1b
commit 66eb0b91b8

@ -272,7 +272,7 @@ export class DocWorkerApi {
const fieldNames = new Set<string>(_.flatMap(records, r => Object.keys(r.fields ?? {})));
const result: BulkColValues = {};
for (const fieldName of fieldNames) {
result[fieldName] = records.map(record => record.fields?.[fieldName] || null);
result[fieldName] = records.map(record => record.fields?.[fieldName] ?? null);
}
return result;
}

Loading…
Cancel
Save