diff --git a/packages/server/src/db/index.js b/packages/server/src/db/index.js index 5fd793821..44dd8f1a2 100755 --- a/packages/server/src/db/index.js +++ b/packages/server/src/db/index.js @@ -577,9 +577,8 @@ async function getGrantsNew(filters, paginationParams, orderingParams, tenantId, .modify((qb) => grantsQuery(qb, filters, agencyId, orderingParams, paginationParams)); const counts = await knex(TABLES.grants) - .distinct() .modify((qb) => grantsQuery(qb, filters, agencyId, { orderBy: undefined }, null)) - .count('grant_id as total_grants'); + .countDistinct('grants.grant_id as total_grants'); const pagination = { total: counts[0].total_grants,