From adf27ffe9f7ab061b72c6cc54ca49213aa5d27fe Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 26 Sep 2022 21:28:04 -0700 Subject: invoice updates --- src/routes/invoice/+server.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/routes/invoice/+server.js') diff --git a/src/routes/invoice/+server.js b/src/routes/invoice/+server.js index c408c4e5..4538256c 100644 --- a/src/routes/invoice/+server.js +++ b/src/routes/invoice/+server.js @@ -1,8 +1,16 @@ import { auth, get, post } from '$lib/utils'; export async function POST({ request, parent }) { - let { amount, currency, network = 'lightning', rate, tip, username } = await request.json(); - let invoice = { amount, currency, network, rate, tip }; + let { + amount, + currency, + network = 'lightning', + prompt, + rate, + tip, + username + } = await request.json(); + let invoice = { amount, currency, network, prompt, rate, tip }; if (network === 'lightning') { invoice.text = (await post('/lightning/invoice', { amount }, auth(request))).text; @@ -10,7 +18,7 @@ export async function POST({ request, parent }) { invoice.address = (await get('/address?network=bitcoin&type=bech32')).address; } - console.log("INVOICE", invoice) + console.log('INVOICE', invoice); return new Response( JSON.stringify(await post('/invoice', { invoice, user: { username } }, auth(request))), -- cgit v1.2.3