fix wallet creation without vaultEntries
This commit is contained in:
parent
1f71a9e187
commit
7b4a33b354
|
@ -743,11 +743,15 @@ async function upsertWallet (
|
|||
type: wallet.type,
|
||||
// client only wallets has no walletData
|
||||
...(Object.keys(walletData).length > 0 ? { [wallet.field]: { create: walletData } } : {}),
|
||||
vaultEntries: {
|
||||
createMany: {
|
||||
data: vaultEntries?.map(({ key, iv, value }) => ({ key, iv, value, userId: me.id }))
|
||||
}
|
||||
}
|
||||
...(vaultEntries
|
||||
? {
|
||||
vaultEntries: {
|
||||
createMany: {
|
||||
data: vaultEntries?.map(({ key, iv, value }) => ({ key, iv, value, userId: me.id }))
|
||||
}
|
||||
}
|
||||
}
|
||||
: {})
|
||||
}
|
||||
})
|
||||
)
|
||||
|
|
|
@ -10,7 +10,6 @@ export const fields = [
|
|||
name: 'url',
|
||||
label: 'lnbits url',
|
||||
type: 'text',
|
||||
required: true,
|
||||
validate: process.env.NODE_ENV === 'development'
|
||||
? string()
|
||||
.or([string().matches(/^(http:\/\/)?localhost:\d+$/), string().url()], 'invalid url')
|
||||
|
|
Loading…
Reference in New Issue