diff --git a/pom.xml b/pom.xml index 9d5b7d5..daeaf6e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.haiti.filter haiti-filter-quarkus-reactive - 0.3.0 + 0.3.1 jar Haiti Filter Reactive Quarkus diff --git a/src/main/java/dev/struchkov/haiti/filter/quarkus/CriteriaFilter.java b/src/main/java/dev/struchkov/haiti/filter/quarkus/CriteriaFilter.java index b379d7f..83eb310 100644 --- a/src/main/java/dev/struchkov/haiti/filter/quarkus/CriteriaFilter.java +++ b/src/main/java/dev/struchkov/haiti/filter/quarkus/CriteriaFilter.java @@ -116,7 +116,7 @@ public class CriteriaFilter { totalElements, results.size(), results ) .page(offset.getPageNumber()) - .totalPages(totalElements / results.size()) + .totalPages(results.isEmpty() ? offset.getPageNumber() : totalElements / results.size()) .build(); } );