Merge pull request #2268 from gradido/fix-linked-user-email

fix: Linked User Email in Transaction List
This commit is contained in:
Moriz Wahl 2022-10-18 15:38:17 +02:00 committed by GitHub
commit 52d84dd43c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -6,7 +6,7 @@ import CONFIG from '@/config'
import { Context, getUser } from '@/server/context'
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
import { getCustomRepository, getConnection } from '@dbTools/typeorm'
import { getCustomRepository, getConnection, In } from '@dbTools/typeorm'
import { sendTransactionReceivedEmail } from '@/mailer/sendTransactionReceivedEmail'
@ -224,11 +224,11 @@ export class TransactionResolver {
logger.debug(`involvedUserIds=${involvedUserIds}`)
// We need to show the name for deleted users for old transactions
const involvedDbUsers = await dbUser
.createQueryBuilder()
.withDeleted()
.where('id IN (:...userIds)', { userIds: involvedUserIds })
.getMany()
const involvedDbUsers = await dbUser.find({
where: { id: In(involvedUserIds) },
withDeleted: true,
relations: ['emailContact'],
})
const involvedUsers = involvedDbUsers.map((u) => new User(u))
logger.debug(`involvedUsers=${involvedUsers}`)

View File

@ -37,6 +37,7 @@ export const transactionsQuery = gql`
linkedUser {
firstName
lastName
email
}
decay {
decay
@ -44,9 +45,6 @@ export const transactionsQuery = gql`
end
duration
}
linkedUser {
email
}
transactionLinkId
}
}