Skip to content

Commit 1889d6c

Browse files
committed
Fixed pagination for myorg endpoint.(sort)
1 parent 3cefa1f commit 1889d6c

File tree

1 file changed

+2
-1
lines changed
  • server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.lowcoder.sdk.config.CommonConfig;
2424
import org.lowcoder.sdk.constants.AuthSourceConstants;
2525
import org.lowcoder.sdk.exception.BizError;
26+
import org.springframework.data.domain.Sort;
2627
import org.springframework.http.HttpStatus;
2728
import org.springframework.http.codec.multipart.Part;
2829
import org.springframework.web.bind.annotation.*;
@@ -80,7 +81,7 @@ public Mono<ResponseView<?>> getUserOrgs(ServerWebExchange exchange,
8081
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
8182
return sessionUserService.getVisitor()
8283
.flatMap(user -> {
83-
Pageable pageable = PageRequest.of(pageNum - 1, pageSize);
84+
Pageable pageable = PageRequest.of(pageNum - 1, pageSize, Sort.by(Sort.Direction.DESC, "updatedAt"));
8485
String filter = orgName == null ? "" : orgName;
8586
return organizationService.findUserOrgs(user.getId(), filter, pageable)
8687
.map(OrgView::new)

0 commit comments

Comments
 (0)