diff options
| author | Adam Soltys <[email protected]> | 2022-07-26 23:37:18 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-07-26 23:42:48 -0700 |
| commit | cd9e850f9e15e890727026942d646d59f526fe4e (patch) | |
| tree | e730dae8f2f0dcd14db634ea331ffecde6ce333e /src/routes | |
| parent | cf7278f54bac6b0dc048df41d92e1cdcf18c2840 (diff) | |
| download | coinos-ui-cd9e850f9e15e890727026942d646d59f526fe4e.tar.gz coinos-ui-cd9e850f9e15e890727026942d646d59f526fe4e.zip | |
fix invoice endpoint
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/invoice.js | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/routes/invoice.js b/src/routes/invoice.js index 147da2b7..4b3327f6 100644 --- a/src/routes/invoice.js +++ b/src/routes/invoice.js @@ -1,21 +1,12 @@ -import got from 'got'; +import { post } from '$lib/utils'; import { invoiceAmount } from '$lib/store'; const username = 'bob', network = 'lightning'; export async function GET({ params }) { - let text = await got - .post('http://localhost:3119/lightning/invoice', { - json: { amount: invoiceAmount } - }) - .text(); - - await got - .post('http://localhost:3119/invoice', { - json: { invoice: { text, network }, user: { username } } - }) - .json(); + let { text } = await post('/lightning/invoice', { amount: invoiceAmount }); + await post('/invoice', { invoice: { text, network }, user: { username } }); return { body: { text } }; } |
