aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-14 11:19:12 -0800
committerAdam Soltys <[email protected]>2023-02-14 11:19:12 -0800
commit979d9dd27a147bae13ba953a7e260412fa024f57 (patch)
tree9331037cb4880270044b8acc468b9898a16ce639 /src/routes/(app)/send
parent60b24b3d5951e159d09f42ed766c404e4b1acc4e (diff)
downloadcoinos-ui-979d9dd27a147bae13ba953a7e260412fa024f57.tar.gz
coinos-ui-979d9dd27a147bae13ba953a7e260412fa024f57.zip
handle sending to user
Diffstat (limited to 'src/routes/(app)/send')
-rw-r--r--src/routes/(app)/send/[...text]/+page.server.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js
index d09b4da9..b1089a5b 100644
--- a/src/routes/(app)/send/[...text]/+page.server.js
+++ b/src/routes/(app)/send/[...text]/+page.server.js
@@ -45,14 +45,15 @@ let parse = async (t, host) => {
// bitcoin
if (validate(t)) {
try {
- ({ id } = await get(`/invoice/${t}`));
+ ({ id, user } = await get(`/invoice/${t}`));
} catch (e) {
let r = `/send/bitcoin/${t}`;
if (amount) r += '/' + amount;
throw redirect(307, r);
}
- if (id) throw redirect(307, `/send/${id}`);
+ if (user) throw redirect(307, `/send/${user.username}`);
+ else if (id) throw redirect(307, `/send/${id}`);
}
// user