From 3960e57a1cb0ff9c62073464487405d3cbd3ca78 Mon Sep 17 00:00:00 2001 From: Mykhaylo Date: Wed, 11 Nov 2020 11:52:25 +0100 Subject: [PATCH] fixed wrong pagination of collections --- .../dspace/app/rest/repository/CollectionRestRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java index f273d6434e..4beeb61adc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java @@ -177,7 +177,7 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository collections = cs.findCollectionsWithSubmit(q, context, com, Math.toIntExact(pageable.getOffset()), - Math.toIntExact(pageable.getOffset() + pageable.getPageSize())); + Math.toIntExact(pageable.getPageSize())); int tot = cs.countCollectionsWithSubmit(q, context, com); return converter.toRestPage(collections, pageable, tot , utils.obtainProjection()); } catch (SQLException | SearchServiceException e) { @@ -192,7 +192,7 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository collections = cs.findCollectionsWithSubmit(q, context, null, Math.toIntExact(pageable.getOffset()), - Math.toIntExact(pageable.getOffset() + pageable.getPageSize())); + Math.toIntExact(pageable.getPageSize())); int tot = cs.countCollectionsWithSubmit(q, context, null); return converter.toRestPage(collections, pageable, tot, utils.obtainProjection()); } catch (SQLException e) {