diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index 57b808a85f..1e57416cd1 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -133,7 +133,11 @@ export async function find(ctx: UserCtx): Promise { } 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) { diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index 933e9bd2f5..773b54dd6a 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -200,7 +200,10 @@ export async function inputProcessing( export async function outputProcessing( table: Table, rows: T, - opts = { squash: true } + opts: { squash?: boolean; preserveLinks?: boolean } = { + squash: true, + preserveLinks: false, + } ): Promise { let safeRows: Row[] let wasArray = true @@ -211,7 +214,9 @@ export async function outputProcessing( safeRows = rows } // attach any linked row information - let enriched = await linkRows.attachFullLinkedDocs(table, safeRows) + let enriched = !opts.preserveLinks + ? await linkRows.attachFullLinkedDocs(table, safeRows) + : safeRows // process formulas enriched = processFormulas(table, enriched, { dynamic: true }) as Row[]