diff options
| author | Adam Soltys <[email protected]> | 2024-10-31 09:34:16 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-31 09:34:16 -0700 |
| commit | 243abb0a3d29e8e34e263eec843488e3bdb468a4 (patch) | |
| tree | be55931ba0f3c110c3001f56a5339cb63e78b761 /src/routes/(app)/send/bitcoin | |
| parent | 4742e72ec25823ceeea7848fb2e1f868bed7f472 (diff) | |
| download | coinos-ui-243abb0a3d29e8e34e263eec843488e3bdb468a4.tar.gz coinos-ui-243abb0a3d29e8e34e263eec843488e3bdb468a4.zip | |
biome
Diffstat (limited to 'src/routes/(app)/send/bitcoin')
| -rw-r--r-- | src/routes/(app)/send/bitcoin/[address]/+layout.server.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts index a6edf8b0..68191311 100644 --- a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts +++ b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts @@ -2,22 +2,22 @@ import { auth, get } from "$lib/utils"; import { redirect } from "@sveltejs/kit"; export async function load({ cookies, params, parent }) { - let { user } = await parent(); - let aid = cookies.get("aid"); - let { address } = params; - let { balance } = await get(`/account/${aid}`, auth(cookies)); + const { user } = await parent(); + const aid = cookies.get("aid"); + const { address } = params; + const { balance } = await get(`/account/${aid}`, auth(cookies)); - try { - let invoice = await get(`/invoice/${address}`); + try { + const invoice = await get(`/invoice/${address}`); - if (invoice) { - let recipient = await get(`/users/${invoice.uid}`); - if (recipient?.id !== user.id) - redirect(307, `/pay/${recipient.username}`); - } - } catch (e) { - // invoice not found - } + if (invoice) { + const recipient = await get(`/users/${invoice.uid}`); + if (recipient?.id !== user.id) + redirect(307, `/pay/${recipient.username}`); + } + } catch (e) { + // invoice not found + } - return { balance }; + return { balance }; } |
