Skip to content

Commit

Permalink
Merge pull request #43 from sammarks/count-clear-select
Browse files Browse the repository at this point in the history
fix: clear select before querying counts
  • Loading branch information
dmerrill6 authored Sep 7, 2020
2 parents 0ea288a + 337e22e commit e2865c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/orm-connectors/knex/custom-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const removeNodesFromBeginning = (nodesAccessor, last, { orderColumn, ascOrDesc


const getNodesLength = async (nodesAccessor) => {
const counts = await nodesAccessor.clone().count('*');
const counts = await nodesAccessor.clone().clearSelect().count('*');
const result = counts.reduce((prev, curr) => {
const currCount = curr.count || curr['count(*)'];
if (!currCount) return prev;
Expand Down

0 comments on commit e2865c2

Please sign in to comment.