You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ar...@apache.org on 2023/11/08 12:27:03 UTC

(fineract) branch develop updated: FINERACT-1971: Added default values for LoanAccountLockApi for paging parameters

This is an automated email from the ASF dual-hosted git repository.

arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9efe4f7ed FINERACT-1971: Added default values for LoanAccountLockApi for paging parameters
9efe4f7ed is described below

commit 9efe4f7ed522bbf75887a592099d1a6335dd6ce3
Author: Arnold Galovics <ga...@gmail.com>
AuthorDate: Wed Nov 8 09:22:16 2023 +0100

    FINERACT-1971: Added default values for LoanAccountLockApi for paging parameters
---
 .../org/apache/fineract/cob/api/LoanAccountLockApiResource.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/cob/api/LoanAccountLockApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/cob/api/LoanAccountLockApiResource.java
index 45c9d6e56..3b56e7250 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/cob/api/LoanAccountLockApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/cob/api/LoanAccountLockApiResource.java
@@ -35,6 +35,7 @@ import jakarta.ws.rs.core.UriInfo;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import lombok.RequiredArgsConstructor;
 import org.apache.fineract.cob.data.LoanAccountLockResponseDTO;
@@ -64,8 +65,10 @@ public class LoanAccountLockApiResource {
     @Operation(summary = "List locked loan accounts", description = "Returns the locked loan IDs")
     @ApiResponses({
             @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = LoanAccountLockApiResourceSwagger.GetLoanAccountLockResponse.class))) })
-    public String retrieveLockedAccounts(@Context final UriInfo uriInfo, @QueryParam("page") Integer page,
-            @QueryParam("limit") Integer limit) {
+    public String retrieveLockedAccounts(@Context final UriInfo uriInfo, @QueryParam("page") Integer pageParam,
+            @QueryParam("limit") Integer limitParam) {
+        int page = Objects.requireNonNullElse(pageParam, 0);
+        int limit = Objects.requireNonNullElse(limitParam, 50);
 
         List<LoanAccountLock> lockedLoanAccounts = loanAccountLockService.getLockedLoanAccountByPage(page, limit);
         LoanAccountLockResponseDTO response = new LoanAccountLockResponseDTO();