Clientes
This commit is contained in:
parent
f2ef5d2267
commit
88f5062c03
@ -189,13 +189,12 @@ export class CustomerRepository
|
|||||||
deleted_at: null,
|
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,
|
...query,
|
||||||
transaction,
|
transaction,
|
||||||
});*/
|
});
|
||||||
|
|
||||||
const [rows, count] = await Promise.all([
|
/*const [rows, count] = await Promise.all([
|
||||||
CustomerModel.findAll({
|
CustomerModel.findAll({
|
||||||
...CustomerModel,
|
...CustomerModel,
|
||||||
transaction,
|
transaction,
|
||||||
@ -205,7 +204,7 @@ export class CustomerRepository
|
|||||||
distinct: true, // evita duplicados por LEFT JOIN
|
distinct: true, // evita duplicados por LEFT JOIN
|
||||||
transaction,
|
transaction,
|
||||||
}),
|
}),
|
||||||
]);
|
]);*/
|
||||||
|
|
||||||
return mapper.mapToDTOCollection(rows, count);
|
return mapper.mapToDTOCollection(rows, count);
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user