Skip to content

Commit 29689c8

Browse files
committed
Fixed pagination start value
1 parent 91215b2 commit 29689c8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/organization/service/OrgMemberServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public Flux<OrgMember> getOrganizationMembers(String orgId) {
5353

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

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/GroupApiServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Mono<GroupMemberAggregateView> getGroupMembers(String groupId, int page,
9898
.filter(Objects::nonNull)
9999
.toList();
100100
var pageTotal = list.size();
101-
list = list.subList(page * count, Math.min(page * count + count, pageTotal));
101+
list = list.subList((page - 1) * count, count == 0 ? pageTotal : Math.min(page * count, pageTotal));
102102
return Pair.of(list, pageTotal);
103103
});
104104
})

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/OrgApiServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private Mono<OrgMemberListView> getOrgMemberListView(String orgId, int page, int
106106
.filter(Objects::nonNull)
107107
.collect(Collectors.toList());
108108
var pageTotal = list.size();
109-
list = list.subList(page * count, Math.min(page * count + count, pageTotal));
109+
list = list.subList((page - 1) * count, count == 0 ? pageTotal : Math.min(page * count, pageTotal));
110110
return Pair.of(list, pageTotal);
111111
});
112112
})

0 commit comments

Comments
 (0)