aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-07 13:58:00 -0700
committerAdam Soltys <[email protected]>2022-09-07 13:58:00 -0700
commitec5a14d7d61d5f1797fcfba67dd2d8ef0cca2360 (patch)
tree0b138f7fce9b7b6f64bdbb8c0a0103d48f9088b5 /src/routes/invoice
parent7efa00c9a9cf6587e9c24c1c94d3c8969949e360 (diff)
downloadcoinos-ui-ec5a14d7d61d5f1797fcfba67dd2d8ef0cca2360.tar.gz
coinos-ui-ec5a14d7d61d5f1797fcfba67dd2d8ef0cca2360.zip
image uploads
Diffstat (limited to 'src/routes/invoice')
-rw-r--r--src/routes/invoice/+server.js1
-rw-r--r--src/routes/invoice/[id]/+page.server.js3
-rw-r--r--src/routes/invoice/[id]/+page.svelte4
3 files changed, 3 insertions, 5 deletions
diff --git a/src/routes/invoice/+server.js b/src/routes/invoice/+server.js
index a4c4f9c8..225f6bb1 100644
--- a/src/routes/invoice/+server.js
+++ b/src/routes/invoice/+server.js
@@ -3,7 +3,6 @@ import { auth, get, post } from '$lib/utils';
export async function POST({ request }) {
let network = 'lightning';
let { amount, currency, rate, tip, text, username } = await request.json();
-
({ text } = await post('/lightning/invoice', { amount }, auth(request)));
let invoice = { amount, currency, network, rate, tip, text };
let { uuid } = await post('/invoice', { invoice, user: { username } }, auth(request));
diff --git a/src/routes/invoice/[id]/+page.server.js b/src/routes/invoice/[id]/+page.server.js
index 5ab0069a..e123c7d7 100644
--- a/src/routes/invoice/[id]/+page.server.js
+++ b/src/routes/invoice/[id]/+page.server.js
@@ -1,5 +1,4 @@
-import cookie from 'cookie';
-import { get, post } from '$lib/utils';
+import { get } from '$lib/utils';
export async function load({ params }) {
let { id } = params;
diff --git a/src/routes/invoice/[id]/+page.svelte b/src/routes/invoice/[id]/+page.svelte
index e8d5562c..f6ecdc0e 100644
--- a/src/routes/invoice/[id]/+page.svelte
+++ b/src/routes/invoice/[id]/+page.svelte
@@ -69,9 +69,9 @@
let update = async () => {
await tick();
- tip = (tipAmount * 100000000) / rate;
+ tip = Math.round((tipAmount * 100000000) / rate);
let r = await post(`/invoice`, {
- amount: amount + tip,
+ amount: parseInt(amount + tip),
rate,
tip,
text,