From 445fc590400f2c6229e659140e2f671d75fe221b Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Fri, 8 Nov 2024 04:12:29 -0500 Subject: [PATCH] fix: last item removal in backward pagination --- core/api/src/services/ledger/paginated-ledger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/api/src/services/ledger/paginated-ledger.ts b/core/api/src/services/ledger/paginated-ledger.ts index 6eb50219a0..542a746b54 100644 --- a/core/api/src/services/ledger/paginated-ledger.ts +++ b/core/api/src/services/ledger/paginated-ledger.ts @@ -85,7 +85,7 @@ export const paginatedLedger = async ({ if (transactionRecords.length > last) { hasPreviousPage = true - transactionRecords = transactionRecords.slice(1) // Remove the extra record + transactionRecords = transactionRecords.slice(0, last) // Remove the extra record } // Reverse the results to maintain consistent ordering (newest first)