mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
fixed wrong pagination of collections
This commit is contained in:
@@ -177,7 +177,7 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository<Collect
|
|||||||
}
|
}
|
||||||
List<Collection> collections = cs.findCollectionsWithSubmit(q, context, com,
|
List<Collection> collections = cs.findCollectionsWithSubmit(q, context, com,
|
||||||
Math.toIntExact(pageable.getOffset()),
|
Math.toIntExact(pageable.getOffset()),
|
||||||
Math.toIntExact(pageable.getOffset() + pageable.getPageSize()));
|
Math.toIntExact(pageable.getPageSize()));
|
||||||
int tot = cs.countCollectionsWithSubmit(q, context, com);
|
int tot = cs.countCollectionsWithSubmit(q, context, com);
|
||||||
return converter.toRestPage(collections, pageable, tot , utils.obtainProjection());
|
return converter.toRestPage(collections, pageable, tot , utils.obtainProjection());
|
||||||
} catch (SQLException | SearchServiceException e) {
|
} catch (SQLException | SearchServiceException e) {
|
||||||
@@ -192,7 +192,7 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository<Collect
|
|||||||
Context context = obtainContext();
|
Context context = obtainContext();
|
||||||
List<Collection> collections = cs.findCollectionsWithSubmit(q, context, null,
|
List<Collection> collections = cs.findCollectionsWithSubmit(q, context, null,
|
||||||
Math.toIntExact(pageable.getOffset()),
|
Math.toIntExact(pageable.getOffset()),
|
||||||
Math.toIntExact(pageable.getOffset() + pageable.getPageSize()));
|
Math.toIntExact(pageable.getPageSize()));
|
||||||
int tot = cs.countCollectionsWithSubmit(q, context, null);
|
int tot = cs.countCollectionsWithSubmit(q, context, null);
|
||||||
return converter.toRestPage(collections, pageable, tot, utils.obtainProjection());
|
return converter.toRestPage(collections, pageable, tot, utils.obtainProjection());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
Reference in New Issue
Block a user