optimize ui loading and dashboard performance
This commit is contained in:
@@ -202,10 +202,10 @@ export class PrismaCdrsRepository implements CdrsRepository {
|
||||
|
||||
async list(query: CdrQuery): Promise<{ items: CdrListItem[]; meta: CdrPageMeta }> {
|
||||
const where = this.where(query);
|
||||
const [items, total] = await this.prisma.$transaction([
|
||||
const [items, total] = await Promise.all([
|
||||
this.prisma.rawCdr.findMany({
|
||||
where,
|
||||
orderBy: [{ startedAt: 'desc' }],
|
||||
orderBy: [{ startedAt: 'desc' }, { id: 'desc' }],
|
||||
take: query.take,
|
||||
skip: query.skip,
|
||||
include: this.includeCdr()
|
||||
|
||||
Reference in New Issue
Block a user