mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
use forEach instead of for loop in transactions,
simplified code
This commit is contained in:
parent
e69437cb9f
commit
ca3c07b0d8
@ -119,16 +119,13 @@ export class TransactionResolver {
|
||||
}
|
||||
|
||||
// transactions
|
||||
for (let i = 0; i < userTransactions.length; i++) {
|
||||
const userTransaction = userTransactions[i]
|
||||
let linkedUser = null
|
||||
if (userTransaction.typeId === TransactionTypeId.CREATION) {
|
||||
linkedUser = communityUser
|
||||
} else {
|
||||
linkedUser = involvedUsers.find((u) => u.id === userTransaction.linkedUserId)
|
||||
}
|
||||
userTransactions.forEach((userTransaction) => {
|
||||
const linkedUser =
|
||||
userTransaction.typeId === TransactionTypeId.CREATION
|
||||
? communityUser
|
||||
: involvedUsers.find((u) => u.id === userTransaction.linkedUserId)
|
||||
transactions.push(new Transaction(userTransaction, self, linkedUser))
|
||||
}
|
||||
})
|
||||
|
||||
// Construct Result
|
||||
return new TransactionList(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user