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 { Context, getUser } from '@/server/context'
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql' 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' import { sendTransactionReceivedEmail } from '@/mailer/sendTransactionReceivedEmail'
@ -224,11 +224,11 @@ export class TransactionResolver {
logger.debug(`involvedUserIds=${involvedUserIds}`) logger.debug(`involvedUserIds=${involvedUserIds}`)
// 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.find({
.createQueryBuilder() where: { id: In(involvedUserIds) },
.withDeleted() withDeleted: true,
.where('id IN (:...userIds)', { userIds: involvedUserIds }) relations: ['emailContact'],
.getMany() })
const involvedUsers = involvedDbUsers.map((u) => new User(u)) const involvedUsers = involvedDbUsers.map((u) => new User(u))
logger.debug(`involvedUsers=${involvedUsers}`) logger.debug(`involvedUsers=${involvedUsers}`)

View File

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