aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/invoice.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-08 10:13:03 -0800
committerAdam Soltys <[email protected]>2023-02-08 10:13:03 -0800
commit3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2 (patch)
treee22c32c9948e4bacfc14bdc8f95a16c557a916e5 /src/lib/invoice.js
parent38a1046a92a8f6e3168c5054dc7de2cb3fd8e726 (diff)
downloadcoinos-ui-3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2.tar.gz
coinos-ui-3b7e5e3492684b3d08f37cb078d6eec3fa4da0b2.zip
rm uuid route
Diffstat (limited to 'src/lib/invoice.js')
-rw-r--r--src/lib/invoice.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/invoice.js b/src/lib/invoice.js
index 5b939079..bb75d4cb 100644
--- a/src/lib/invoice.js
+++ b/src/lib/invoice.js
@@ -7,6 +7,7 @@ export default async ({ cookies, request, url }) => {
let rates = await get('/rates');
let amount = parseInt(form.get('amount'));
let request_id = form.get('request_id');
+ if (request_id === 'undefined') request_id = undefined;
let invoice = {
amount,
@@ -19,11 +20,12 @@ export default async ({ cookies, request, url }) => {
let user = { username: form.get('username'), currency: form.get('currency') };
- let { hash } = await post('/invoice', { invoice, user }, auth(cookies));
+ invoice = await post('/invoice', { invoice, user }, auth(cookies));
+ let { hash } = invoice;
if (request_id) {
if (url.pathname.endsWith('tip')) {
- throw redirect(307, `/send/${hash}`);
+ throw redirect(307, `/send/invoice/${hash}`);
}
throw redirect(307, `/${user.username}/request/${request_id}`);