diff options
Diffstat (limited to 'src/routes/invoice')
| -rw-r--r-- | src/routes/invoice/+server.js | 1 | ||||
| -rw-r--r-- | src/routes/invoice/[id]/+page.server.js | 3 | ||||
| -rw-r--r-- | src/routes/invoice/[id]/+page.svelte | 4 |
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, |
