diff options
| author | Adam Soltys <[email protected]> | 2022-11-12 20:47:03 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-12 20:47:03 -0800 |
| commit | 76bbc66976aaec36424259415d460c32745fe616 (patch) | |
| tree | 0f64c0b5c5d630301256d83d0454da2ccc887925 | |
| parent | c29c24e25bba912aaa54bf76b17d044acf3d6ec0 (diff) | |
| download | coinos-ui-76bbc66976aaec36424259415d460c32745fe616.tar.gz coinos-ui-76bbc66976aaec36424259415d460c32745fe616.zip | |
parse request_id
| -rw-r--r-- | src/lib/invoice.js | 8 |
1 files changed, 4 insertions, 4 deletions
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) { |
