mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Use knex instance property in MetaService class
This commit is contained in:
@@ -32,12 +32,12 @@ export class MetaService {
|
||||
}
|
||||
|
||||
async totalCount(collection: string) {
|
||||
const records = await database(collection).count('*', { as: 'count' });
|
||||
const records = await this.knex(collection).count('*', { as: 'count' });
|
||||
return Number(records[0].count);
|
||||
}
|
||||
|
||||
async filterCount(collection: string, query: Query) {
|
||||
const dbQuery = database(collection).count('*', { as: 'count' });
|
||||
const dbQuery = this.knex(collection).count('*', { as: 'count' });
|
||||
|
||||
if (query.filter) {
|
||||
await applyFilter(this.knex, dbQuery, query.filter, collection);
|
||||
|
||||
Reference in New Issue
Block a user