Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
CITIZENDOT committed Aug 15, 2024
1 parent 7a1b961 commit 563cab0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/knex/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,9 @@ export class KnexAdapter<
async _find(params?: ServiceParams): Promise<Paginated<Result> | Result[]>
async _find(params: ServiceParams = {} as ServiceParams): Promise<Paginated<Result> | Result[]> {
const { filters, paginate } = this.filterQuery(params)
const { name, id } = this.getOptions(params)
const { Model, name, id } = this.getOptions(params)
const builder = params.knex ? params.knex.clone() : this.createQuery(params)
const countBuilder = this.db()
.count(`* as total`)
const countBuilder = Model.count(`* as total`)
.with('subquery', builder.clone().clearOrder())
.from('subquery')
// Handle $limit
Expand Down

0 comments on commit 563cab0

Please sign in to comment.