Fix w.default usage

Since package.json with { "type": "module" } was added, this is no longer needed.
This commit is contained in:
ekzyis 2024-07-16 22:38:27 +02:00
parent 128f1f93b8
commit e25a3dbec0
2 changed files with 4 additions and 8 deletions

View File

@ -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 }) => {

View File

@ -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 },