From f0617ab73b7e5a0017b5005d8a163e9ef510f059 Mon Sep 17 00:00:00 2001 From: Guillaume Mercey Date: Sun, 23 May 2021 01:54:48 -0700 Subject: [PATCH] Remove groupBy when counting rows for pagination (#150) --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 936b25b..5092dd2 100644 --- a/src/index.js +++ b/src/index.js @@ -558,7 +558,7 @@ class Service extends AdapterService { if (count) { const countColumns = groupByColumns || (Array.isArray(this.id) ? this.id.map(idKey => `${this.Model.tableName}.${idKey}`) : [`${this.Model.tableName}.${this.id}`]); - const countQuery = this._createQuery(params); + const countQuery = this._createQuery(params).clear('groupBy'); if (query.$joinRelation) { countQuery