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