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
|
||||
const limit = currentPage === 1 && order === Order.DESC ? pageSize - 1 : pageSize
|
||||
const offset =
|
||||
currentPage === 1 ? 0 : (currentPage - 1) * pageSize - (order === Order.DESC ? 1 : 0)
|
||||
// first page can contain 26 due to virtual decay transaction
|
||||
const offset = (currentPage - 1) * pageSize
|
||||
const transactionRepository = getCustomRepository(TransactionRepository)
|
||||
const [userTransactions, userTransactionsCount] = await transactionRepository.findByUserPaged(
|
||||
user.id,
|
||||
limit,
|
||||
pageSize,
|
||||
offset,
|
||||
order,
|
||||
onlyCreations,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user