1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Attempting without promise.all in external.

This commit is contained in:
mike12345567 2024-06-20 16:18:32 +01:00
parent 66ef0cb79a
commit 295961edb1

View file

@ -81,15 +81,11 @@ export async function search(
paginate: paginateObj as PaginationJson,
includeSqlRelationships: IncludeRelationship.INCLUDE,
}
const queries: Promise<Row[] | number>[] = []
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