diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index 268b4ad9..88a064b9 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -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 })) + } + } + } + : {}) } }) ) diff --git a/wallets/lnbits/index.js b/wallets/lnbits/index.js index 008c072f..3dcc8af1 100644 --- a/wallets/lnbits/index.js +++ b/wallets/lnbits/index.js @@ -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')