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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user