Renames
This commit is contained in:
parent
de29d31c35
commit
73ec0bbf09
|
@ -154,9 +154,6 @@ export async function finaliseRow(
|
|||
if (updateFormula) {
|
||||
await updateRelatedFormula(table, enrichedRow)
|
||||
}
|
||||
const squashed = await linkRows.squashLinksToPrimaryDisplay(
|
||||
table,
|
||||
enrichedRow
|
||||
)
|
||||
const squashed = await linkRows.squashLinks(table, enrichedRow)
|
||||
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.
|
||||
* @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,
|
||||
enriched: Row[] | Row
|
||||
) {
|
||||
enriched: T
|
||||
): Promise<T> {
|
||||
// will populate this as we find them
|
||||
const linkedTables = [table]
|
||||
const isArray = Array.isArray(enriched)
|
||||
|
|
|
@ -343,10 +343,7 @@ export async function outputProcessing<T extends Row[] | Row>(
|
|||
enriched = await processFormulas(table, enriched, { dynamic: true })
|
||||
|
||||
if (opts.squash) {
|
||||
enriched = (await linkRows.squashLinksToPrimaryDisplay(
|
||||
table,
|
||||
enriched
|
||||
)) as Row[]
|
||||
enriched = await linkRows.squashLinks(table, enriched)
|
||||
}
|
||||
// remove null properties to match internal API
|
||||
const isExternal = isExternalTableID(table._id!)
|
||||
|
|
Loading…
Reference in New Issue