From c7c6ee7ba59467b8ddcfe8196b4f7586a864f3c0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 13 Feb 2026 21:07:55 -0800 Subject: account level currency and autowithdraw settings --- routes/users.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'routes/users.ts') diff --git a/routes/users.ts b/routes/users.ts index 89920748..d1df6e5d 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -954,13 +954,19 @@ export default { async updateAccount(req, res) { const { id } = req.params; const { id: uid } = req.user; - const { name } = req.body; + const { name, autowithdraw, threshold, reserve, destination, currency } = + req.body; const pos = await db.lPos(`${uid}:accounts`, id); if (pos == null) fail("account not found"); const account = await g(`account:${id}`); - account.name = name; + if (name !== undefined) account.name = name; + if (autowithdraw !== undefined) account.autowithdraw = autowithdraw; + if (threshold !== undefined) account.threshold = threshold; + if (reserve !== undefined) account.reserve = reserve; + if (destination !== undefined) account.destination = destination.trim(); + if (currency !== undefined) account.currency = currency; await s(`account:${id}`, account); res.send(account); -- cgit v1.2.3