diff options
| author | Adam Soltys <[email protected]> | 2025-08-21 11:38:42 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-08-21 11:38:42 -0700 |
| commit | c1310f5d2fce5fd9df42c8cc8753ea5895aab377 (patch) | |
| tree | de657d8eabd57143c3ac05f9d62571a544847fcf /routes | |
| parent | d2b99925d1e09de63207b4948d6970065dc64371 (diff) | |
| download | coinos-server-c1310f5d2fce5fd9df42c8cc8753ea5895aab377.tar.gz coinos-server-c1310f5d2fce5fd9df42c8cc8753ea5895aab377.zip | |
fix invoice update
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/invoices.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routes/invoices.ts b/routes/invoices.ts index 37b79e8a..a2bab026 100644 --- a/routes/invoices.ts +++ b/routes/invoices.ts @@ -55,9 +55,10 @@ export default { const { body } = req; if (!body.invoice?.tip || body.invoice.tip < 0) fail("Invalid tip"); - const invoice = await g(`invoice:${id}`); + let invoice = await g(`invoice:${id}`); + const user = await g(`user:${invoice.uid}`); invoice.tip = body.invoice.tip; - invoice.amount += invoice.tip; + invoice = await generate({ invoice, user }); await s(`invoice:${id}`, invoice); res.send(invoice); |
