mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
implement KISS on transaction list length - first page contains 26 instead of 25 transactions now due to virtual decay transaction
This commit is contained in:
parent
3af5ee13b9
commit
29b1d44cdd
@ -80,13 +80,12 @@ export class TransactionResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find transactions
|
// find transactions
|
||||||
const limit = currentPage === 1 && order === Order.DESC ? pageSize - 1 : pageSize
|
// first page can contain 26 due to virtual decay transaction
|
||||||
const offset =
|
const offset = (currentPage - 1) * pageSize
|
||||||
currentPage === 1 ? 0 : (currentPage - 1) * pageSize - (order === Order.DESC ? 1 : 0)
|
|
||||||
const transactionRepository = getCustomRepository(TransactionRepository)
|
const transactionRepository = getCustomRepository(TransactionRepository)
|
||||||
const [userTransactions, userTransactionsCount] = await transactionRepository.findByUserPaged(
|
const [userTransactions, userTransactionsCount] = await transactionRepository.findByUserPaged(
|
||||||
user.id,
|
user.id,
|
||||||
limit,
|
pageSize,
|
||||||
offset,
|
offset,
|
||||||
order,
|
order,
|
||||||
onlyCreations,
|
onlyCreations,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user