mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove duplicate Transaction[] variable
This commit is contained in:
parent
4e017e4017
commit
f137314438
@ -123,12 +123,11 @@ export class TransactionResolver {
|
|||||||
)
|
)
|
||||||
skipFirstTransaction = userTransactionsCount > offset + limit
|
skipFirstTransaction = userTransactionsCount > offset + limit
|
||||||
const decay = !(currentPage > 1)
|
const decay = !(currentPage > 1)
|
||||||
let transactions: Transaction[] = []
|
const transactions: Transaction[] = []
|
||||||
if (userTransactions.length) {
|
if (userTransactions.length) {
|
||||||
if (order === Order.DESC) {
|
if (order === Order.DESC) {
|
||||||
userTransactions.reverse()
|
userTransactions.reverse()
|
||||||
}
|
}
|
||||||
const finalTransactions: Transaction[] = []
|
|
||||||
const involvedUserIds: number[] = []
|
const involvedUserIds: number[] = []
|
||||||
|
|
||||||
userTransactions.forEach((transaction: dbTransaction) => {
|
userTransactions.forEach((transaction: dbTransaction) => {
|
||||||
@ -205,7 +204,7 @@ export class TransactionResolver {
|
|||||||
throw new Error('invalid transaction')
|
throw new Error('invalid transaction')
|
||||||
}
|
}
|
||||||
if (i > 0 || !skipFirstTransaction) {
|
if (i > 0 || !skipFirstTransaction) {
|
||||||
finalTransactions.push(finalTransaction)
|
transactions.push(finalTransaction)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i === userTransactions.length - 1 && decay) {
|
if (i === userTransactions.length - 1 && decay) {
|
||||||
@ -223,10 +222,9 @@ export class TransactionResolver {
|
|||||||
decayTransaction.decayDuration = decay.decayDuration
|
decayTransaction.decayDuration = decay.decayDuration
|
||||||
decayTransaction.decayStart = decay.decayStart
|
decayTransaction.decayStart = decay.decayStart
|
||||||
decayTransaction.decayEnd = decay.decayEnd
|
decayTransaction.decayEnd = decay.decayEnd
|
||||||
finalTransactions.push(decayTransaction)
|
transactions.push(decayTransaction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transactions = finalTransactions
|
|
||||||
|
|
||||||
if (order === Order.DESC) {
|
if (order === Order.DESC) {
|
||||||
transactions.reverse()
|
transactions.reverse()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user