From a55eb812c4ea6dc9573f2bdf40f058a1d3ba90ee Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 19 Jan 2025 23:49:20 -0800 Subject: return public fields only --- routes/payments.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/payments.ts b/routes/payments.ts index 75d667f2..1ff0be05 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -20,6 +20,7 @@ import { SATS, bail, fail, + fields, getInvoice, getPayment, getUser, @@ -115,7 +116,7 @@ export default { return p; } if (p.created < start || p.created > end) return; - if (p.type === types.internal) p.with = await g(`user:${p.ref}`); + if (p.type === types.internal) p.with = await getUser(p.ref, fields); return p; }), ) @@ -164,7 +165,7 @@ export default { params: { hash }, } = req; const p = await getPayment(hash); - if (p?.type === types.internal) p.with = await g(`user:${p.ref}`); + if (p?.type === types.internal) p.with = await getUser(p.ref, fields); res.send(p); } catch (e) { console.log(e); -- cgit v1.2.3