diff options
| author | Adam Soltys <[email protected]> | 2023-01-13 20:26:53 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-13 20:26:53 -0800 |
| commit | 277b921ab2a97ac170f980c3c916ab1488318f2f (patch) | |
| tree | af771877eb261c41aa158aef2dddf96fa40f653c /src/routes/(app)/send | |
| parent | e0671101e4b217ff891fad85482e5943aa5cf543 (diff) | |
| download | coinos-ui-277b921ab2a97ac170f980c3c916ab1488318f2f.tar.gz coinos-ui-277b921ab2a97ac170f980c3c916ab1488318f2f.zip | |
server redis migration
Diffstat (limited to 'src/routes/(app)/send')
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.server.js | 10 | ||||
| -rw-r--r-- | src/routes/(app)/send/[uuid=uuid]/+page.server.js | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js index ee31ade7..eab57d64 100644 --- a/src/routes/(app)/send/[...text]/+page.server.js +++ b/src/routes/(app)/send/[...text]/+page.server.js @@ -6,7 +6,7 @@ import { invalid, redirect } from '@sveltejs/kit'; let parse = async (t, host) => { if (!t) return; - let amount, user, uuid; + let amount, user, id; t = t.trim(); t.toLowerCase().startsWith('bitcoin:') && @@ -34,25 +34,25 @@ let parse = async (t, host) => { // lightning if (t.toLowerCase().startsWith('ln')) { try { - ({ uuid } = await get(`/invoice/${t}`)); + ({ id } = await get(`/invoice/${t}`)); } catch (e) { throw redirect(307, `/send/lightning/${t}`); } - if (uuid) throw redirect(307, `/send/${uuid}`); + if (id) throw redirect(307, `/send/${id}`); } // bitcoin if (validate(t)) { try { - ({ uuid } = await get(`/invoice/${t}`)); + ({ id } = await get(`/invoice/${t}`)); } catch (e) { let r = `/send/bitcoin/${t}`; if (amount) r += '/' + amount; throw redirect(307, r); } - if (uuid) throw redirect(307, `/send/${uuid}`); + if (id) throw redirect(307, `/send/${id}`); } // user diff --git a/src/routes/(app)/send/[uuid=uuid]/+page.server.js b/src/routes/(app)/send/[uuid=uuid]/+page.server.js index 63192b7a..dd6fb82d 100644 --- a/src/routes/(app)/send/[uuid=uuid]/+page.server.js +++ b/src/routes/(app)/send/[uuid=uuid]/+page.server.js @@ -4,7 +4,7 @@ import { btc as asset, auth, get, post } from '$lib/utils'; export async function load({ params, parent }) { let { user } = await parent(); - let { amount, address, tip, text, user: recipient } = await get(`/invoice/${params.uuid}`); + let { amount, address, tip, text, user: recipient } = await get(`/invoice/${params.id}`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); if (tip) amount += tip; return { amount, address, payreq: text, recipient }; |
