[ 
https://issues.apache.org/jira/browse/FINERACT-2013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18097073#comment-18097073
 ] 

Yash Goswmai commented on FINERACT-2013:
----------------------------------------

I investigated the audit trail pagination issue reported in FINERACT-2013.

Root cause:
The count query generated for paginated audit results was not removing 
LIMIT/OFFSET clauses because the regex used for removal was case-sensitive. The 
generated SQL contained lowercase `limit` and `offset`, causing the count query 
to return incorrect results.

Fix:
Updated the LIMIT/OFFSET removal logic in `DatabaseSpecificSQLGenerator` to 
handle case-insensitive SQL keywords.

Verification:
Before the fix, the audit API returned:
{
    "totalFilteredRecords": 0,
    "pageItems": []
}

even when audit records existed.

After the fix, the API correctly returned:
{
    "totalFilteredRecords": 3,
    "pageItems": [...]
}

PR: <your PR link>

The audit trail pagination issue is fixed with this change.

> Pagination does not work on some APIs that feeds the UI
> -------------------------------------------------------
>
>                 Key: FINERACT-2013
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2013
>             Project: Apache Fineract
>          Issue Type: New Feature
>            Reporter: Peter Santa
>            Priority: Major
>              Labels: BeanSalad
>
> h1. Issue
> There are some APIs, on which the allegedly supported pagination does not 
> work.
> [https://github.com/openMF/web-app/issues/1865] states that they are not 
> web-app bugs.
> Currently known cases:
>  * audit trail - does not work at all, checking from web-app.
>  * GL entry list - initial load shows 50 as "Item per page", but 10 is shown.
> h1. Expected behaviour
> When opening a view, the initial view contains as many items, as it is shown 
> as "Item per page".
> When "Item per page" gets modified, it gets applied.
> Next/Previous/First/Last page clicking works.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to