Skip to content

Commit

Permalink
Fixed pagination start value
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonpoo committed Nov 27, 2024
1 parent 91215b2 commit 29689c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Flux<OrgMember> getOrganizationMembers(String orgId) {

@Override
public Flux<OrgMember> getOrganizationMembers(String orgId, int page, int count) {
return biRelationService.getBySourceId(ORG_MEMBER, orgId, PageRequest.of(page, count))
return biRelationService.getBySourceId(ORG_MEMBER, orgId, PageRequest.of(page - 1, count))
.map(OrgMember::from);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Mono<GroupMemberAggregateView> getGroupMembers(String groupId, int page,
.filter(Objects::nonNull)
.toList();
var pageTotal = list.size();
list = list.subList(page * count, Math.min(page * count + count, pageTotal));
list = list.subList((page - 1) * count, count == 0 ? pageTotal : Math.min(page * count, pageTotal));
return Pair.of(list, pageTotal);
});
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private Mono<OrgMemberListView> getOrgMemberListView(String orgId, int page, int
.filter(Objects::nonNull)
.collect(Collectors.toList());
var pageTotal = list.size();
list = list.subList(page * count, Math.min(page * count + count, pageTotal));
list = list.subList((page - 1) * count, count == 0 ? pageTotal : Math.min(page * count, pageTotal));
return Pair.of(list, pageTotal);
});
})
Expand Down

0 comments on commit 29689c8

Please sign in to comment.