aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-21 22:57:03 -0800
committerAdam Soltys <[email protected]>2024-11-21 22:57:03 -0800
commitf041c7fa846fb80d920b00b20aeba4925865cc68 (patch)
tree8bdd2b659810e15c8814065a16d903d86a18daa5 /routes
parentf0ef70adc613c85f58ccc679f3a4d2d3b2d09e71 (diff)
downloadcoinos-server-cashreq.tar.gz
coinos-server-cashreq.zip
return pidcashreq
Diffstat (limited to 'routes')
-rw-r--r--routes/ecash.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/routes/ecash.ts b/routes/ecash.ts
index 35d9f950..6aac01a8 100644
--- a/routes/ecash.ts
+++ b/routes/ecash.ts
@@ -16,10 +16,11 @@ const sendCash = async ({ amount, user }) => {
const p = await debit({ hash, amount, user, type });
const token = await mint(parseInt(amount));
p.memo = id;
- await s(`payment:${p.id}`, p);
+ const { id: pid } = p;
+ await s(`payment:${pid}`, p);
s(`cash:${id}`, token);
- return { id, token };
+ return { id, token, pid };
};
export default {
@@ -39,10 +40,10 @@ export default {
async get(req, res) {
const {
- params: { id, version },
+ params: { id },
} = req;
try {
- const token = await get(id, version);
+ const token = await get(id);
const status = await check(token);
res.send({ token, status });
} catch (e) {