diff options
| author | Adam Soltys <[email protected]> | 2024-08-31 15:23:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-08-31 15:23:49 -0700 |
| commit | a89d4ee9b9bf0c15505a58803585f1847731983e (patch) | |
| tree | 46098814beabc79de334898dbc4808aed8d5f329 /src/routes/(app)/send/invoice | |
| parent | df71664f20312e81134ee90ad561f55d3020ee0a (diff) | |
| download | coinos-ui-a89d4ee9b9bf0c15505a58803585f1847731983e.tar.gz coinos-ui-a89d4ee9b9bf0c15505a58803585f1847731983e.zip | |
typescript
Diffstat (limited to 'src/routes/(app)/send/invoice')
| -rw-r--r-- | src/routes/(app)/send/invoice/[id]/+page.server.ts | 4 | ||||
| -rw-r--r-- | src/routes/(app)/send/invoice/[id]/+page.svelte | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.ts b/src/routes/(app)/send/invoice/[id]/+page.server.ts index 2662e771..ed0198cf 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.ts +++ b/src/routes/(app)/send/invoice/[id]/+page.server.ts @@ -1,7 +1,7 @@ import { error, redirect } from "@sveltejs/kit"; import { fd, auth, get, post } from "$lib/utils"; -export async function load({ params: { id }, parent, url }) { +export async function load({ params: { id }, parent }) { let { rates, user } = await parent(); let invoice = await get(`/invoice/${id}`); @@ -27,7 +27,7 @@ export const actions = { body.hash = id; await post("/payments", body, auth(cookies)); - } catch (e) { + } catch (e: any) { console.log("payment failed", id, e); error(500, e.message); } diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index bc62b5f5..81a2c521 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -49,6 +49,7 @@ }; let submitting; + let toggle = () => (submitting = !submitting); let external = async () => { let { id } = await post(`/${recipient.username}/invoice`, { @@ -168,7 +169,7 @@ /> {/if} - <form method="POST" use:enhance={handler(submitting)}> + <form method="POST" use:enhance={handler(toggle)}> <input name="address" value={address} type="hidden" /> <input name="amount" value={amount} type="hidden" /> <input name="payreq" value={payreq} type="hidden" /> |
