From ec396e85219889322bfbd7800e28cb3330b350c3 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 1 Dec 2022 12:45:15 +0100 Subject: [PATCH] Merge master. --- backend/src/graphql/resolver/TransactionResolver.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 25260e963..5fb13ba6b 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -206,7 +206,7 @@ export class TransactionResolver { // find current balance const lastTransaction = await dbTransaction.findOne( { userId: user.id }, - { order: { balanceDate: 'DESC' }, relations: ['contribution'] }, + { order: { balanceDate: 'DESC' } }, ) logger.debug(`lastTransaction=${lastTransaction}`) @@ -313,10 +313,6 @@ export class TransactionResolver { @Ctx() context: Context, ): Promise { logger.info(`sendCoins(email=${email}, amount=${amount}, memo=${memo})`) - if (amount.lte(0)) { - logger.error(`Amount to send must be positive`) - throw new Error('Amount to send must be positive') - } // TODO this is subject to replay attacks const senderUser = getUser(context) @@ -327,7 +323,6 @@ export class TransactionResolver { // validate recipient user const recipientUser = await findUserByEmail(email) - if (recipientUser.deletedAt) { logger.error(`The recipient account was deleted: recipientUser=${recipientUser}`) throw new Error('The recipient account was deleted')