Skip to content

Commit

Permalink
Merge branch 'hotfix-3.1.2' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicWatson committed Apr 20, 2021
2 parents d95e700 + 382dede commit 3c66aa7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v3.1.2

* Pass through all args when using recordCountOnly=true to ensure saved/extra filters are included

## v3.1.1

* Add `getMultipleRecords()` method for embedding entities
Expand Down
8 changes: 6 additions & 2 deletions services/DataApiService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ component {
}

var result = {
records = _selectData( arguments.entity, args, arguments.fields )
, totalCount = _selectData( arguments.entity, { recordCountOnly=true, filter=args.filter } )
records = _selectData( arguments.entity, args, arguments.fields )
};

args.recordCountOnly = true;
structDelete( args, "maxRows" );

result.totalCount = _selectData( arguments.entity, args, arguments.fields )

result.totalPages = Ceiling( result.totalCount / arguments.pageSize );
result.prevPage = arguments.page -1;
result.nextPage = arguments.page >= result.totalPages ? 0 : arguments.page+1;
Expand Down

0 comments on commit 3c66aa7

Please sign in to comment.