From f041c7fa846fb80d920b00b20aeba4925865cc68 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 21 Nov 2024 22:57:03 -0800 Subject: return pid --- routes/ecash.ts | 9 +++++---- 1 file 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) { -- cgit v1.2.3