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) => {
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
})