From 88f5062c036ef8077feb6e7f848f53fce1789a7c Mon Sep 17 00:00:00 2001 From: david Date: Fri, 24 Oct 2025 13:07:09 +0200 Subject: [PATCH] Clientes --- .../sequelize/repositories/customer.repository.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts b/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts index e7234623..5dbc08d8 100644 --- a/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts +++ b/modules/customers/src/api/infrastructure/sequelize/repositories/customer.repository.ts @@ -189,13 +189,12 @@ export class CustomerRepository deleted_at: null, }; - // Reemplazar findAndCountAll por findAll + count (más control y mejor rendimiento) - /*const { rows, count } = await CustomerModel.findAndCountAll({ + const { rows, count } = await CustomerModel.findAndCountAll({ ...query, transaction, - });*/ + }); - const [rows, count] = await Promise.all([ + /*const [rows, count] = await Promise.all([ CustomerModel.findAll({ ...CustomerModel, transaction, @@ -205,7 +204,7 @@ export class CustomerRepository distinct: true, // evita duplicados por LEFT JOIN transaction, }), - ]); + ]);*/ return mapper.mapToDTOCollection(rows, count); } catch (err: unknown) {