fix: await in transaction

This commit is contained in:
Riccardo Balbo 2024-10-14 19:46:12 +02:00 committed by k00b
parent a95e4cd6e9
commit 6f1113636f
1 changed files with 4 additions and 4 deletions

View File

@ -682,7 +682,7 @@ async function upsertWallet (
return await models.$transaction(async (tx) => { return await models.$transaction(async (tx) => {
if (canReceive) { if (canReceive) {
tx.user.update({ await tx.user.update({
where: { id: me.id }, where: { id: me.id },
data: { data: {
autoWithdrawMaxFeePercent, autoWithdrawMaxFeePercent,
@ -699,7 +699,7 @@ async function upsertWallet (
}) })
: undefined : undefined
updatedWallet = tx.wallet.update({ updatedWallet = await tx.wallet.update({
where: { id: Number(id), userId: me.id }, where: { id: Number(id), userId: me.id },
data: { data: {
enabled, enabled,
@ -720,7 +720,7 @@ async function upsertWallet (
} }
}) })
} else { } else {
updatedWallet = tx.wallet.create({ updatedWallet = await tx.wallet.create({
data: { data: {
enabled, enabled,
priority, priority,
@ -771,7 +771,7 @@ async function upsertWallet (
}) })
} }
tx.walletLog.createMany({ await tx.walletLog.createMany({
data: logs data: logs
}) })