diff options
| author | Adam Soltys <[email protected]> | 2022-09-26 21:28:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-26 21:28:04 -0700 |
| commit | adf27ffe9f7ab061b72c6cc54ca49213aa5d27fe (patch) | |
| tree | 8fcbfd0c141894c8d9d5a9ff86bebc9355c58052 /src/routes/invoice/+server.js | |
| parent | 7881ecd6a4fcbb820ee1607f1e7f6fcc3ce15dfe (diff) | |
| download | coinos-ui-adf27ffe9f7ab061b72c6cc54ca49213aa5d27fe.tar.gz coinos-ui-adf27ffe9f7ab061b72c6cc54ca49213aa5d27fe.zip | |
invoice updates
Diffstat (limited to 'src/routes/invoice/+server.js')
| -rw-r--r-- | src/routes/invoice/+server.js | 14 |
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))), |
