Renames
This commit is contained in:
parent
de29d31c35
commit
73ec0bbf09
3 changed files with 5 additions and 11 deletions
|
@ -154,9 +154,6 @@ export async function finaliseRow(
|
||||||
if (updateFormula) {
|
if (updateFormula) {
|
||||||
await updateRelatedFormula(table, enrichedRow)
|
await updateRelatedFormula(table, enrichedRow)
|
||||||
}
|
}
|
||||||
const squashed = await linkRows.squashLinksToPrimaryDisplay(
|
const squashed = await linkRows.squashLinks(table, enrichedRow)
|
||||||
table,
|
|
||||||
enrichedRow
|
|
||||||
)
|
|
||||||
return { row: enrichedRow, squashed, table }
|
return { row: enrichedRow, squashed, table }
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,10 +247,10 @@ function getPrimaryDisplayValue(row: Row, table?: Table) {
|
||||||
* @param enriched The pre-enriched rows (full docs) which are to be squashed.
|
* @param enriched The pre-enriched rows (full docs) which are to be squashed.
|
||||||
* @returns The rows after having their links squashed to only contain the ID and primary display.
|
* @returns The rows after having their links squashed to only contain the ID and primary display.
|
||||||
*/
|
*/
|
||||||
export async function squashLinksToPrimaryDisplay(
|
export async function squashLinks<T = Row[] | Row>(
|
||||||
table: Table,
|
table: Table,
|
||||||
enriched: Row[] | Row
|
enriched: T
|
||||||
) {
|
): Promise<T> {
|
||||||
// will populate this as we find them
|
// will populate this as we find them
|
||||||
const linkedTables = [table]
|
const linkedTables = [table]
|
||||||
const isArray = Array.isArray(enriched)
|
const isArray = Array.isArray(enriched)
|
||||||
|
|
|
@ -343,10 +343,7 @@ export async function outputProcessing<T extends Row[] | Row>(
|
||||||
enriched = await processFormulas(table, enriched, { dynamic: true })
|
enriched = await processFormulas(table, enriched, { dynamic: true })
|
||||||
|
|
||||||
if (opts.squash) {
|
if (opts.squash) {
|
||||||
enriched = (await linkRows.squashLinksToPrimaryDisplay(
|
enriched = await linkRows.squashLinks(table, enriched)
|
||||||
table,
|
|
||||||
enriched
|
|
||||||
)) as Row[]
|
|
||||||
}
|
}
|
||||||
// remove null properties to match internal API
|
// remove null properties to match internal API
|
||||||
const isExternal = isExternalTableID(table._id!)
|
const isExternal = isExternalTableID(table._id!)
|
||||||
|
|
Loading…
Reference in a new issue