aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-07-26 23:37:18 -0700
committerAdam Soltys <[email protected]>2022-07-26 23:42:48 -0700
commit6e4a5f60018d5c3f9a5391fb4f5a2916c952c569 (patch)
tree1f00904f301ca5256af1f669690995d0a3988eee /src/routes
parent0bc80131a3e5bedd55903a56397109a45cdcb47c (diff)
downloadcoinos-ui-6e4a5f60018d5c3f9a5391fb4f5a2916c952c569.tar.gz
coinos-ui-6e4a5f60018d5c3f9a5391fb4f5a2916c952c569.zip
fix invoice endpoint
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/invoice.js15
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 } };
}