aboutsummaryrefslogtreecommitdiffstats
path: root/routes/invoices.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-26 21:17:43 -0700
committerAdam Soltys <[email protected]>2024-08-26 21:17:43 -0700
commitfe62cadd6fb4a7e49f7d59401fc74ae0411e32a7 (patch)
treeaa8f34e1692bd2d638a2c996eeadb58671d07aea /routes/invoices.js
parent00e43ddc0bf3d6dd719fc9295d156567fa2fecfb (diff)
downloadcoinos-server-fe62cadd6fb4a7e49f7d59401fc74ae0411e32a7.tar.gz
coinos-server-fe62cadd6fb4a7e49f7d59401fc74ae0411e32a7.zip
typescript
Diffstat (limited to 'routes/invoices.js')
-rw-r--r--routes/invoices.js38
1 files changed, 0 insertions, 38 deletions
diff --git a/routes/invoices.js b/routes/invoices.js
deleted file mode 100644
index 5cc60e05..00000000
--- a/routes/invoices.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import { g, s } from "$lib/db";
-import { generate } from "$lib/invoices";
-import { bail, fail, pick } from "$lib/utils";
-import whitelist from "$lib/whitelist";
-import got from "got";
-import config from "$config";
-import ln from "$lib/ln";
-
-export default {
- async get({ params: { id } }, res) {
- let invoice = await g(`invoice:${id}`);
- if (typeof invoice === "string") invoice = await g(`invoice:${invoice}`);
-
- if (invoice) {
- delete invoice.secret;
- invoice.user = pick(await g(`user:${invoice.uid}`), [
- "id",
- "profile",
- "banner",
- "currency",
- "username",
- "pubkey",
- ]);
-
- invoice.items ||= [];
- }
- if (invoice) res.send(invoice);
- else res.code(500).send("invoice not found");
- },
-
- async create({ body: { invoice, user }, user: sender }, res) {
- try {
- res.send(await generate({ invoice, user, sender }));
- } catch (e) {
- bail(res, e.message);
- }
- },
-};