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,
})
row[fieldName] = await outputProcessing<Row[]>(
linkedTable,
relatedRows.rows,
{
squash: true,
preserveLinks: true,
}
)
row[fieldName] = await outputProcessing(linkedTable, relatedRows.rows, {
squash: true,
preserveLinks: true,
})
}
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
export async function trimNonViewFields(
async function trimNonViewFields(
row: Row,
view: ViewV2,
permission: "WRITE" | "READ"

View File

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

View File

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

View File

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