From a4744dd588af7f38226db674c3a6a5bc85e5d923 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Oct 2021 12:35:31 +0200 Subject: [PATCH] use enum for comparison instead of a number --- backend/src/graphql/resolvers/TransactionResolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolvers/TransactionResolver.ts b/backend/src/graphql/resolvers/TransactionResolver.ts index f079da9ca..a601d9575 100644 --- a/backend/src/graphql/resolvers/TransactionResolver.ts +++ b/backend/src/graphql/resolvers/TransactionResolver.ts @@ -50,7 +50,7 @@ async function calculateAndAddDecayTransactions( const transactionIndiced: dbTransaction[] = [] transactions.forEach((transaction: dbTransaction) => { transactionIndiced[transaction.id] = transaction - if (transaction.transactionTypeId === 2) { + if (transaction.transactionTypeId === TransactionTypeId.SEND) { involvedUserIds.push(transaction.transactionSendCoin.userId) involvedUserIds.push(transaction.transactionSendCoin.recipiantUserId) } @@ -97,7 +97,7 @@ async function calculateAndAddDecayTransactions( } } - // sender or receiver when user has sended money + // sender or receiver when user has sent money // group name if creation // type: gesendet / empfangen / geschöpft // transaktion nr / id