do not test invoice when disabling wallets

This commit is contained in:
Riccardo Balbo 2024-10-16 10:17:04 +02:00 committed by k00b
parent 240040f2a3
commit 0263aa8372
1 changed files with 4 additions and 10 deletions

View File

@ -672,7 +672,10 @@ async function upsertWallet (
if (!me) throw new GqlAuthenticationError() if (!me) throw new GqlAuthenticationError()
assertApiKeyNotPermitted({ me }) assertApiKeyNotPermitted({ me })
if (testCreateInvoice && !priorityOnly && canReceive) { const { id, ...walletData } = data
const { autoWithdrawThreshold, autoWithdrawMaxFeePercent, enabled, priority } = settings
if (testCreateInvoice && !priorityOnly && canReceive && enabled) {
try { try {
await testCreateInvoice(data) await testCreateInvoice(data)
} catch (err) { } catch (err) {
@ -685,15 +688,6 @@ async function upsertWallet (
} }
} }
const { id, ...walletData } = data
const {
autoWithdrawThreshold,
autoWithdrawMaxFeePercent,
autoWithdrawMaxFeeTotal,
enabled,
priority
} = settings
return await models.$transaction(async (tx) => { return await models.$transaction(async (tx) => {
if (canReceive) { if (canReceive) {
await tx.user.update({ await tx.user.update({