From 9efe4f7ed522bbf75887a592099d1a6335dd6ce3 Mon Sep 17 00:00:00 2001 From: Arnold Galovics Date: Wed, 8 Nov 2023 09:22:16 +0100 Subject: [PATCH] FINERACT-1971: Added default values for LoanAccountLockApi for paging parameters --- .../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 45c9d6e56e6..3b56e7250bd 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 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 lockedLoanAccounts = loanAccountLockService.getLockedLoanAccountByPage(page, limit); LoanAccountLockResponseDTO response = new LoanAccountLockResponseDTO();