properly use findOne where

This commit is contained in:
Ulf Gebhardt 2023-01-11 13:14:50 +01:00
parent c9488c8b81
commit 8628a05a21
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -557,8 +557,8 @@ export class ContributionResolver {
const releaseLock = await TRANSACTIONS_LOCK.acquire()
const clientTimezoneOffset = getClientTimezoneOffset(context)
const contribution = await DbContribution.findOne({ id, confirmedAt: IsNull() })
if (!contribution) {P
const contribution = await DbContribution.findOne({ where: { id, confirmedAt: IsNull() } })
if (!contribution) {
logger.error(`Contribution not found to given id (${id}) or already confirmed`)
throw new Error('Contribution not found to given id or already confirmed.')
}