From 4826a5fbbfd3dbdbc6c980fa8fdb8106a581fa86 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 28 Aug 2024 10:33:22 +0200 Subject: [PATCH] Clean ts --- packages/server/src/api/controllers/row/external.ts | 12 ++++-------- packages/server/src/middleware/trimViewRowInfo.ts | 2 +- packages/server/src/sdk/app/rows/search/external.ts | 4 ++-- .../src/sdk/app/rows/search/internal/internal.ts | 2 +- .../server/src/sdk/app/rows/search/internal/sqs.ts | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index e14e2d454a..a99b5d4b4d 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -163,14 +163,10 @@ export async function fetchEnrichedRow(ctx: UserCtx) { }, includeSqlRelationships: IncludeRelationship.INCLUDE, }) - row[fieldName] = await outputProcessing( - linkedTable, - relatedRows.rows, - { - squash: true, - preserveLinks: true, - } - ) + row[fieldName] = await outputProcessing(linkedTable, relatedRows.rows, { + squash: true, + preserveLinks: true, + }) } return row } diff --git a/packages/server/src/middleware/trimViewRowInfo.ts b/packages/server/src/middleware/trimViewRowInfo.ts index 2d29a88a6f..0a5f066c9e 100644 --- a/packages/server/src/middleware/trimViewRowInfo.ts +++ b/packages/server/src/middleware/trimViewRowInfo.ts @@ -28,7 +28,7 @@ export default async (ctx: Ctx, 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" diff --git a/packages/server/src/sdk/app/rows/search/external.ts b/packages/server/src/sdk/app/rows/search/external.ts index 992596ab34..d90b1545ba 100644 --- a/packages/server/src/sdk/app/rows/search/external.ts +++ b/packages/server/src/sdk/app/rows/search/external.ts @@ -112,7 +112,7 @@ export async function search( : Promise.resolve(undefined), ]) - let processed = await outputProcessing(table, rows, { + let processed = await outputProcessing(table, rows, { preserveLinks: true, squash: true, }) @@ -260,7 +260,7 @@ export async function fetch(tableId: string): Promise { includeSqlRelationships: IncludeRelationship.INCLUDE, }) const table = await sdk.tables.getTable(tableId) - return await outputProcessing(table, response.rows, { + return await outputProcessing(table, response.rows, { preserveLinks: true, squash: true, }) diff --git a/packages/server/src/sdk/app/rows/search/internal/internal.ts b/packages/server/src/sdk/app/rows/search/internal/internal.ts index ae7bca3b0c..6617fc376c 100644 --- a/packages/server/src/sdk/app/rows/search/internal/internal.ts +++ b/packages/server/src/sdk/app/rows/search/internal/internal.ts @@ -61,7 +61,7 @@ export async function exportRows( }) ).rows.map(row => row.doc!) - result = await outputProcessing(table, response) + result = await outputProcessing(table, response) } else if (query) { let searchResponse = await sdk.rows.search({ tableId, diff --git a/packages/server/src/sdk/app/rows/search/internal/sqs.ts b/packages/server/src/sdk/app/rows/search/internal/sqs.ts index 6736ff6abf..6ae58ebb34 100644 --- a/packages/server/src/sdk/app/rows/search/internal/sqs.ts +++ b/packages/server/src/sdk/app/rows/search/internal/sqs.ts @@ -379,7 +379,7 @@ export async function search( } // get the rows - let finalRows = await outputProcessing(table, processed, { + let finalRows = await outputProcessing(table, processed, { preserveLinks: true, squash: true, })