Fix test
This commit is contained in:
parent
0cec026932
commit
fad4f12e26
|
@ -133,7 +133,11 @@ export async function find(ctx: UserCtx): Promise<Row> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const table = await sdk.tables.getTable(tableId)
|
const table = await sdk.tables.getTable(tableId)
|
||||||
return await outputProcessing(table, row)
|
// Preserving links, as the outputProcessing does not support external rows yet and we don't need it in this use case
|
||||||
|
return await outputProcessing(table, row, {
|
||||||
|
squash: false,
|
||||||
|
preserveLinks: true,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function destroy(ctx: UserCtx) {
|
export async function destroy(ctx: UserCtx) {
|
||||||
|
|
|
@ -200,7 +200,10 @@ export async function inputProcessing(
|
||||||
export async function outputProcessing<T extends Row[] | Row>(
|
export async function outputProcessing<T extends Row[] | Row>(
|
||||||
table: Table,
|
table: Table,
|
||||||
rows: T,
|
rows: T,
|
||||||
opts = { squash: true }
|
opts: { squash?: boolean; preserveLinks?: boolean } = {
|
||||||
|
squash: true,
|
||||||
|
preserveLinks: false,
|
||||||
|
}
|
||||||
): Promise<T> {
|
): Promise<T> {
|
||||||
let safeRows: Row[]
|
let safeRows: Row[]
|
||||||
let wasArray = true
|
let wasArray = true
|
||||||
|
@ -211,7 +214,9 @@ export async function outputProcessing<T extends Row[] | Row>(
|
||||||
safeRows = rows
|
safeRows = rows
|
||||||
}
|
}
|
||||||
// attach any linked row information
|
// attach any linked row information
|
||||||
let enriched = await linkRows.attachFullLinkedDocs(table, safeRows)
|
let enriched = !opts.preserveLinks
|
||||||
|
? await linkRows.attachFullLinkedDocs(table, safeRows)
|
||||||
|
: safeRows
|
||||||
|
|
||||||
// process formulas
|
// process formulas
|
||||||
enriched = processFormulas(table, enriched, { dynamic: true }) as Row[]
|
enriched = processFormulas(table, enriched, { dynamic: true }) as Row[]
|
||||||
|
|
Loading…
Reference in New Issue