mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix involvedUserIds calculation
This commit is contained in:
parent
29b1d44cdd
commit
2ef0fd18fc
@ -91,16 +91,13 @@ export class TransactionResolver {
|
|||||||
onlyCreations,
|
onlyCreations,
|
||||||
)
|
)
|
||||||
|
|
||||||
// find involved users
|
// find involved users; I am involved
|
||||||
let involvedUserIds: number[] = []
|
const involvedUserIds: number[] = [user.id]
|
||||||
userTransactions.forEach((transaction: dbTransaction) => {
|
userTransactions.forEach((transaction: dbTransaction) => {
|
||||||
involvedUserIds.push(transaction.userId)
|
if (transaction.linkedUserId && !involvedUserIds.includes(transaction.linkedUserId)) {
|
||||||
if (transaction.linkedUserId) {
|
|
||||||
involvedUserIds.push(transaction.linkedUserId)
|
involvedUserIds.push(transaction.linkedUserId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// remove duplicates
|
|
||||||
involvedUserIds = involvedUserIds.filter((value, index, self) => self.indexOf(value) === index)
|
|
||||||
// We need to show the name for deleted users for old transactions
|
// We need to show the name for deleted users for old transactions
|
||||||
const involvedDbUsers = await dbUser
|
const involvedDbUsers = await dbUser
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user