Closed Iamhere closed 3 years ago
Good catch @Iamhere !
I was needed to implement my own paginate method in my project based on this package in order to make it works correctly.
But one more thing is required since Model.count
counts associated raws if include
presents.
const [instances, { length: totalCount }, { length: cursorCount }] =
await Promise.all([
Model.findAll(paginationQueryOptions),
Model.findAll(totalCountQueryOptions),
Model.findAll(cursorCountQueryOptions),
]);
Good catch!
Fix wrong total count when inner join is used. For example: