From 295961edb15c1811060bb86972aeb789a49cdf5b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 20 Jun 2024 16:18:32 +0100 Subject: [PATCH] Attempting without promise.all in external. --- packages/server/src/sdk/app/rows/search/external.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/server/src/sdk/app/rows/search/external.ts b/packages/server/src/sdk/app/rows/search/external.ts index 9fc3487f62..bfb1ccc442 100644 --- a/packages/server/src/sdk/app/rows/search/external.ts +++ b/packages/server/src/sdk/app/rows/search/external.ts @@ -81,15 +81,11 @@ export async function search( paginate: paginateObj as PaginationJson, includeSqlRelationships: IncludeRelationship.INCLUDE, } - const queries: Promise[] = [] - queries.push(handleRequest(Operation.READ, tableId, parameters)) + let rows = await handleRequest(Operation.READ, tableId, parameters) + let totalRows: number | undefined if (countRows) { - queries.push(handleRequest(Operation.COUNT, tableId, parameters)) + totalRows = await handleRequest(Operation.COUNT, tableId, parameters) } - const responses = await Promise.all(queries) - let rows = responses[0] as Row[] - const totalRows = - responses.length > 1 ? (responses[1] as number) : undefined let hasNextPage = false // remove the extra row if it's there