diff options
| author | Adam Soltys <[email protected]> | 2023-12-15 15:24:43 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-15 15:24:43 -0800 |
| commit | 7d598265e60eecf06a27501a85e8db330aeed381 (patch) | |
| tree | 80c73666f5ba3c5f852ac961dd0cf01e551c7896 /src/routes/(app)/send/user | |
| parent | 310687af30375e87679ea5a9ff3fef5a8f4f12fa (diff) | |
| download | coinos-ui-7d598265e60eecf06a27501a85e8db330aeed381.tar.gz coinos-ui-7d598265e60eecf06a27501a85e8db330aeed381.zip | |
sveltekit 2
Diffstat (limited to 'src/routes/(app)/send/user')
| -rw-r--r-- | src/routes/(app)/send/user/[username]/[...amount]/+page.server.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js b/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js index 1f3a0420..e5fa4452 100644 --- a/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js +++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js @@ -9,12 +9,12 @@ export async function load({ cookies, params, parent }) { let [amount, currency] = params.amount.split("/"); if (subject.username === user?.username) - throw error(500, { message: "Cannot send to self" }); + error(500, { message: "Cannot send to self" }); let rate; if (amount) { rate = rates[currency ? currency.toUpperCase() : subject.currency]; - if (!rate) throw error(500, "Invalid currency symbol"); + if (!rate) error(500, "Invalid currency symbol"); if (currency) amount = (amount * sats) / rate; let { hash } = await post( @@ -26,7 +26,7 @@ export async function load({ cookies, params, parent }) { auth(cookies) ); - throw redirect(307, `/${username}/invoice/${hash}`); + redirect(307, `/${username}/invoice/${hash}`); } return { amount, rate, subject }; @@ -42,6 +42,6 @@ export const actions = { return fail(400, { message: e.message }); } - throw redirect(307, "/sent"); + redirect(307, "/sent"); }, }; |
