Fix w.default usage
Since package.json with { "type": "module" } was added, this is no longer needed.
This commit is contained in:
parent
128f1f93b8
commit
e25a3dbec0
|
@ -18,12 +18,8 @@ import { lnAddrOptions } from '@/lib/lnurl'
|
|||
|
||||
function injectResolvers (resolvers) {
|
||||
console.group('injected GraphQL resolvers:')
|
||||
for (
|
||||
// FIXME: this throws
|
||||
// TypeError: import_server.default is not iterable
|
||||
const w of walletDefs) {
|
||||
// app and worker import file differently
|
||||
const { schema, walletType, walletField, testConnect } = w.default || w
|
||||
for (const w of walletDefs) {
|
||||
const { schema, walletType, walletField, testConnect } = w
|
||||
const resolverName = generateResolverName(walletField)
|
||||
console.log(resolverName)
|
||||
resolvers.Mutation[resolverName] = async (parent, { settings, ...data }, { me, models }) => {
|
||||
|
|
|
@ -47,9 +47,9 @@ export async function autoWithdraw ({ data: { id }, models, lnd }) {
|
|||
})
|
||||
|
||||
for (const wallet of wallets) {
|
||||
const w = walletDefs.find(({ default: w }) => w.walletType === wallet.type)
|
||||
const w = walletDefs.find(w => w.walletType === wallet.type)
|
||||
try {
|
||||
const { walletType, walletField, createInvoice } = w.default
|
||||
const { walletType, walletField, createInvoice } = w
|
||||
return await autowithdraw(
|
||||
{ walletType, walletField, createInvoice },
|
||||
{ amount, maxFee },
|
||||
|
|
Loading…
Reference in New Issue