File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -261,14 +261,14 @@ export class SqlDriver implements Driver {
261261 }
262262
263263 async count ( objectName : string , filters : any , options ?: any ) : Promise < number > {
264- // Normalize the query to support both QueryAST and legacy formats
265- const normalizedQuery = this . normalizeQuery ( filters ) ;
266264 const builder = this . getBuilder ( objectName , options ) ;
267265
268- let actualFilters = normalizedQuery ;
269- // If filters is a query object with a 'filters' property, use that
270- if ( normalizedQuery && ! Array . isArray ( normalizedQuery ) && normalizedQuery . filters ) {
271- actualFilters = normalizedQuery . filters ;
266+ // Handle both filter arrays and query objects
267+ let actualFilters = filters ;
268+ if ( filters && ! Array . isArray ( filters ) ) {
269+ // It's a query object, normalize it and extract filters
270+ const normalizedQuery = this . normalizeQuery ( filters ) ;
271+ actualFilters = normalizedQuery . filters || filters ;
272272 }
273273
274274 if ( actualFilters ) {
You can’t perform that action at this time.
0 commit comments