[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: fix pagination
From: |
gnunet |
Subject: |
[libeufin] branch master updated: fix pagination |
Date: |
Tue, 11 Jan 2022 19:05:23 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 5083c9a3 fix pagination
5083c9a3 is described below
commit 5083c9a3d52c1ed65ed535c25b0264c355cdeff1
Author: ms <ms@taler.net>
AuthorDate: Tue Jan 11 19:05:08 2022 +0100
fix pagination
---
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index f55fc72c..7da687c9 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -1330,13 +1330,14 @@ val sandboxApp: Application.() -> Unit = {
}
val lt: BankAccountTransactionEntity? =
bankAccount.lastTransaction
if (lt == null) return@transaction
- var firstElement: BankAccountTransactionEntity = lt
+ var nextPageIdUpperLimit: Long = lt.id.value
/**
* This loop fetches (and discards) pages until the
* desired one is found. */
for (i in 0..(page)) {
- val pageBuf = getPage(firstElement.id.value)
- firstElement = pageBuf.last()
+ val pageBuf = getPage(nextPageIdUpperLimit)
+ if (pageBuf.none()) return@transaction
+ nextPageIdUpperLimit = pageBuf.last().id.value - 1
if (i == page) pageBuf.forEach {
ret.add(getHistoryElementFromTransactionRow(it))
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: fix pagination,
gnunet <=