From fb001b88862af1a1506ba5a632a60116fcb13318 Mon Sep 17 00:00:00 2001 From: elweyn Date: Mon, 13 Dec 2021 11:26:30 +0100 Subject: [PATCH] Change emplacement of receivedDate after possible errors so we don't create the object when we don't need it. --- backend/src/graphql/resolver/AdminResolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index db587aa0d..27e60815b 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -146,11 +146,11 @@ export class AdminResolver { @Mutation(() => Boolean) async confirmPendingCreation(@Arg('id') id: number): Promise { - 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