diff options
| author | Adam Soltys <[email protected]> | 2023-02-01 19:58:13 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-01 19:59:56 +0000 |
| commit | fe0455ffe2d93eda5792ec1ef38348ef24aba2aa (patch) | |
| tree | bf7a50f92102efe926d435268a7963e2a9289e28 | |
| parent | 79caa557bc47d2b727d06c7eaaf3694ccf7202c1 (diff) | |
| download | coinos-server-fe0455ffe2d93eda5792ec1ef38348ef24aba2aa.tar.gz coinos-server-fe0455ffe2d93eda5792ec1ef38348ef24aba2aa.zip | |
preserve user id
| -rw-r--r-- | lib/invoices.js | 2 | ||||
| -rw-r--r-- | routes/invoices.js | 1 | ||||
| -rw-r--r-- | routes/users.js | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/invoices.js b/lib/invoices.js index 814e87d9..4a09f44b 100644 --- a/lib/invoices.js +++ b/lib/invoices.js @@ -12,7 +12,7 @@ import ln from "$lib/ln"; export let generate = async ({ invoice, user, sender }) => { let { currency, tip, amount, rate, request_id, type } = invoice; - amount = parseInt(amount); + amount = parseInt(amount || 0); tip = parseInt(tip || 0); if (amount < 0) fail("amount out of range"); diff --git a/routes/invoices.js b/routes/invoices.js index 2ca3b006..d856ef6b 100644 --- a/routes/invoices.js +++ b/routes/invoices.js @@ -13,6 +13,7 @@ export default { invoice = await got(`${config.classic}/invoice/${hash}`).json(); invoice.id = invoice.uuid; invoice.classic = true; + invoice.user.id = invoice.user.uuid; invoice.user.username += "@classic"; } diff --git a/routes/users.js b/routes/users.js index 0692ed23..e3264937 100644 --- a/routes/users.js +++ b/routes/users.js @@ -235,7 +235,7 @@ export default { headers: { authorization: `Bearer ${config.admin}` } }).json(); - u = { id: v4(), about: u.address, ...pick(u, fields) }; + u = { id: u.uuid, about: u.address, ...pick(u, fields) }; delete u.address; await s(`user:${p.with.username}`, u.id); |
