aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice/+server.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/invoice/+server.js')
-rw-r--r--src/routes/invoice/+server.js14
1 files changed, 11 insertions, 3 deletions
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))),