diff --git a/api/resolvers/serial.js b/api/resolvers/serial.js index e160f32c9..06f088d94 100644 --- a/api/resolvers/serial.js +++ b/api/resolvers/serial.js @@ -85,8 +85,9 @@ export async function serializeInvoicable (query, { models, lnd, hash, hmac, me, let results = await serialize(models, ...trx) if (hash) { - if (invoice?.isHeld) await settleHodlInvoice({ secret: invoice.preimage, lnd }) - results = results.slice(1, -1) + if (invoice?.isHeld) { await settleHodlInvoice({ secret: invoice.preimage, lnd }) } + // remove first element since that is the confirmed invoice + [, ...results] = results } // if there is only one result, return it directly, else the array