chore(medusa): Concurrently get entities and count (#4367)

* chore(medusa): Concurrently get the items and count instead of sequentially

* Create tidy-sloths-sit.md
This commit is contained in:
Adrien de Peretti
2023-06-21 11:28:28 +02:00
committed by GitHub
parent ce4e83b2aa
commit 7bf7d2adef
9 changed files with 19 additions and 11 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ export async function queryEntityWithoutRelations<T extends ObjectLiteral>({
let entities: T[]
let count = 0
if (shouldCount) {
const result = await qb.getManyAndCount()
const result = await Promise.all([qb.getMany(), qb.getCount()])
entities = result[0]
count = result[1]
} else {