From 75e1e4e6aa2dbc7d400df1860758db28bf44b7a3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 13 Jan 2023 20:26:53 -0800 Subject: server redis migration --- src/routes/(app)/send/[...text]/+page.server.js | 10 +++++----- src/routes/(app)/send/[uuid=uuid]/+page.server.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/routes/(app)/send') 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 }; -- cgit v1.2.3