aboutsummaryrefslogtreecommitdiffstats
path: root/routes/invoices.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-06-23 08:48:52 -0700
committerAdam Soltys <[email protected]>2025-06-23 08:50:12 -0700
commit6aa385b4bcfe5a97bbf21263126f61adcd3bc606 (patch)
tree68a65dc4c92e8df1823dcba7047d9680546f9678 /routes/invoices.ts
parente92f232d7194626d9182a5eaeff3d42d67fbb53f (diff)
downloadcoinos-server-6aa385b4bcfe5a97bbf21263126f61adcd3bc606.tar.gz
coinos-server-6aa385b4bcfe5a97bbf21263126f61adcd3bc606.zip
mark self-generated invoices
Diffstat (limited to 'routes/invoices.ts')
-rw-r--r--routes/invoices.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/routes/invoices.ts b/routes/invoices.ts
index 0881c69f..ecac713c 100644
--- a/routes/invoices.ts
+++ b/routes/invoices.ts
@@ -24,11 +24,14 @@ export default {
async create(req, res) {
let { body, user } = req;
- if (body.user) user = body.user;
const { invoice } = body;
+ if (body.user) user = body.user;
+ if (req.user.username === user.username) invoice.own = true;
+
try {
- res.send(await generate({ invoice, user }));
+ const result = await generate({ invoice, user });
+ res.send(result);
} catch (e) {
err(
"problem generating invoice",