From 6f1113636fa7c0e2260d6636803883e22300efd8 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Mon, 14 Oct 2024 19:46:12 +0200 Subject: [PATCH] fix: await in transaction --- api/resolvers/wallet.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index a98bec6d..c2fe95fe 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -682,7 +682,7 @@ async function upsertWallet ( return await models.$transaction(async (tx) => { if (canReceive) { - tx.user.update({ + await tx.user.update({ where: { id: me.id }, data: { autoWithdrawMaxFeePercent, @@ -699,7 +699,7 @@ async function upsertWallet ( }) : undefined - updatedWallet = tx.wallet.update({ + updatedWallet = await tx.wallet.update({ where: { id: Number(id), userId: me.id }, data: { enabled, @@ -720,7 +720,7 @@ async function upsertWallet ( } }) } else { - updatedWallet = tx.wallet.create({ + updatedWallet = await tx.wallet.create({ data: { enabled, priority, @@ -771,7 +771,7 @@ async function upsertWallet ( }) } - tx.walletLog.createMany({ + await tx.walletLog.createMany({ data: logs })