Change emplacement of receivedDate after possible errors so we don't create the object when we don't need it.

This commit is contained in:
elweyn 2021-12-13 11:26:30 +01:00
parent 284984c296
commit fb001b8886

View File

@ -146,11 +146,11 @@ export class AdminResolver {
@Mutation(() => Boolean)
async confirmPendingCreation(@Arg('id') id: number): Promise<boolean> {
const receivedCallDate = new Date()
const pendingCreationRepository = getCustomRepository(PendingCreationRepository)
const pendingCreation = await pendingCreationRepository.findOneOrFail(id)
const transactionRepository = getCustomRepository(TransactionRepository)
const receivedCallDate = new Date()
let transaction = new Transaction()
transaction.transactionTypeId = 1
transaction.memo = pendingCreation.memo