Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
Description
initially, we are fetching the 50 planned payments at the page 0 and getting the planned payments as a response
{
"chargeNames": [
,
,
,
,
,
,
,
,
,
{ "identifier": "interest", "name": "Interest" } ],
"elements": [
{
"interestRate": null,
"costComponents": [
,
,
,
,
,
,
{ "chargeIdentifier": "disburse-payment", "amount": 0 } ],
"remainingPrincipal": 1500,
"date": null
},
{
"interestRate": null,
"costComponents": [
,
,
{ "chargeIdentifier": "track-return-principal", "amount": 751.67 } ],
"remainingPrincipal": 748.33,
"date": "2017-09-01Z"
},
{
"interestRate": null,
"costComponents": [
,
,
{ "chargeIdentifier": "track-return-principal", "amount": 748.33 } ],
"remainingPrincipal": 0,
"date": "2017-10-01Z"
}
],
"totalPages": 1,
"totalElements": 3
}
You can see in response we are getting totalPages and totalElements. We need to refactor our current load more REST API call according to these two parameter otherwise server is giving this error.
{ "timestamp": 1503811590076, "status": 500, "error": "Internal Server Error", "exception": "java.lang.IllegalArgumentException", "message": "org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: fromIndex(50) > toIndex(3)", "path": "/portfolio/v1/individuallending/products/lending/cases/lending_loan_001/plannedpayments" }