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) {
|
function injectResolvers (resolvers) {
|
||||||
console.group('injected GraphQL resolvers:')
|
console.group('injected GraphQL resolvers:')
|
||||||
for (
|
for (const w of walletDefs) {
|
||||||
// FIXME: this throws
|
const { schema, walletType, walletField, testConnect } = w
|
||||||
// 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
|
|
||||||
const resolverName = generateResolverName(walletField)
|
const resolverName = generateResolverName(walletField)
|
||||||
console.log(resolverName)
|
console.log(resolverName)
|
||||||
resolvers.Mutation[resolverName] = async (parent, { settings, ...data }, { me, models }) => {
|
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) {
|
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 {
|
try {
|
||||||
const { walletType, walletField, createInvoice } = w.default
|
const { walletType, walletField, createInvoice } = w
|
||||||
return await autowithdraw(
|
return await autowithdraw(
|
||||||
{ walletType, walletField, createInvoice },
|
{ walletType, walletField, createInvoice },
|
||||||
{ amount, maxFee },
|
{ amount, maxFee },
|
||||||
|
|
Loading…
Reference in New Issue