From 76bbc66976aaec36424259415d460c32745fe616 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 12 Nov 2022 20:47:03 -0800 Subject: parse request_id --- src/lib/invoice.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/invoice.js b/src/lib/invoice.js index 9e71f905..3f4504f2 100644 --- a/src/lib/invoice.js +++ b/src/lib/invoice.js @@ -6,7 +6,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'); + let request_id = parseInt(form.get('request_id')); let invoice = { amount, @@ -22,9 +22,9 @@ export default async ({ cookies, request, url }) => { let { uuid } = await post('/invoice', { invoice, user }, auth(cookies)); if (request_id) { - if (url.pathname.endsWith('tip')) - throw redirect(307, `/send/${uuid}`); - throw redirect(307, `/${user.username}/request/${request_id}`); + console.log("HERE", request_id) + if (url.pathname.endsWith('tip')) throw redirect(307, `/send/${uuid}`); + throw redirect(307, `/${user.username}/request/${request_id}`); } if (invoice.prompt) { -- cgit v1.2.3