1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00
This commit is contained in:
Adria Navarro 2024-08-28 10:33:22 +02:00
parent e29db10a77
commit 4826a5fbbf
5 changed files with 9 additions and 13 deletions

View file

@ -163,14 +163,10 @@ export async function fetchEnrichedRow(ctx: UserCtx) {
}, },
includeSqlRelationships: IncludeRelationship.INCLUDE, includeSqlRelationships: IncludeRelationship.INCLUDE,
}) })
row[fieldName] = await outputProcessing<Row[]>( row[fieldName] = await outputProcessing(linkedTable, relatedRows.rows, {
linkedTable,
relatedRows.rows,
{
squash: true, squash: true,
preserveLinks: true, preserveLinks: true,
} })
)
} }
return row return row
} }

View file

@ -28,7 +28,7 @@ export default async (ctx: Ctx<Row, Row>, next: Next) => {
} }
// have to mutate the koa context, can't return // have to mutate the koa context, can't return
export async function trimNonViewFields( async function trimNonViewFields(
row: Row, row: Row,
view: ViewV2, view: ViewV2,
permission: "WRITE" | "READ" permission: "WRITE" | "READ"

View file

@ -112,7 +112,7 @@ export async function search(
: Promise.resolve(undefined), : Promise.resolve(undefined),
]) ])
let processed = await outputProcessing<Row[]>(table, rows, { let processed = await outputProcessing(table, rows, {
preserveLinks: true, preserveLinks: true,
squash: true, squash: true,
}) })
@ -260,7 +260,7 @@ export async function fetch(tableId: string): Promise<Row[]> {
includeSqlRelationships: IncludeRelationship.INCLUDE, includeSqlRelationships: IncludeRelationship.INCLUDE,
}) })
const table = await sdk.tables.getTable(tableId) const table = await sdk.tables.getTable(tableId)
return await outputProcessing<Row[]>(table, response.rows, { return await outputProcessing(table, response.rows, {
preserveLinks: true, preserveLinks: true,
squash: true, squash: true,
}) })

View file

@ -61,7 +61,7 @@ export async function exportRows(
}) })
).rows.map(row => row.doc!) ).rows.map(row => row.doc!)
result = await outputProcessing<Row[]>(table, response) result = await outputProcessing(table, response)
} else if (query) { } else if (query) {
let searchResponse = await sdk.rows.search({ let searchResponse = await sdk.rows.search({
tableId, tableId,

View file

@ -379,7 +379,7 @@ export async function search(
} }
// get the rows // get the rows
let finalRows = await outputProcessing<Row[]>(table, processed, { let finalRows = await outputProcessing(table, processed, {
preserveLinks: true, preserveLinks: true,
squash: true, squash: true,
}) })