From 5bf4891768f1ee359ee5795272c289b40745aed5 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 30 Jul 2022 11:13:39 -0700 Subject: get invoice by uuid --- src/routes/invoice/[amount].js | 12 -- src/routes/invoice/[amount].svelte | 322 ------------------------------------- src/routes/invoice/[id].js | 11 ++ src/routes/invoice/[id].svelte | 322 +++++++++++++++++++++++++++++++++++++ src/routes/invoice/index.js | 11 ++ 5 files changed, 344 insertions(+), 334 deletions(-) delete mode 100644 src/routes/invoice/[amount].js delete mode 100644 src/routes/invoice/[amount].svelte create mode 100644 src/routes/invoice/[id].js create mode 100644 src/routes/invoice/[id].svelte create mode 100644 src/routes/invoice/index.js (limited to 'src/routes/invoice') diff --git a/src/routes/invoice/[amount].js b/src/routes/invoice/[amount].js deleted file mode 100644 index 9e9678a6..00000000 --- a/src/routes/invoice/[amount].js +++ /dev/null @@ -1,12 +0,0 @@ -import { post } from '$lib/utils'; - -const username = 'bob', - network = 'lightning'; - -export async function GET({ params }) { - let { amount } = params; - let { text } = await post('/lightning/invoice', { amount }); - await post('/invoice', { invoice: { text, network }, user: { username } }); - - return { body: { amount, text } }; -} diff --git a/src/routes/invoice/[amount].svelte b/src/routes/invoice/[amount].svelte deleted file mode 100644 index d1dea907..00000000 --- a/src/routes/invoice/[amount].svelte +++ /dev/null @@ -1,322 +0,0 @@ - - -{#if $user} -
- - -
-
- {#if $invoiceAmount && $invoiceAmountFiat && $rate && text} - -
-

Add a tip?

- -
- {tipAmountFormatted}{`(${tipAmountSats} SATS)`} - {tipPercent}% -
- - { - customTipAmount = ''; - tipPercent = e.target.value; - }} - /> - -
- {#each tipAmounts as amount} - - {/each} - -
- $ - handleCustomTipAmount(e)} - class="bg-primary rounded-2xl py-3 px-10 font-semibold mt-2 mr-1 w-full md:w-auto" - placeholder="Other" - /> - -
-
-
- -