diff options
| author | Adam Soltys <[email protected]> | 2026-02-13 21:07:55 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-13 21:08:04 -0800 |
| commit | c7c6ee7ba59467b8ddcfe8196b4f7586a864f3c0 (patch) | |
| tree | fccdf94755fb1b91c1de65e9d18f2f94742ebe09 /routes | |
| parent | b2b9fe837db7308285909ec1b374546194405d00 (diff) | |
| download | coinos-server-c7c6ee7ba59467b8ddcfe8196b4f7586a864f3c0.tar.gz coinos-server-c7c6ee7ba59467b8ddcfe8196b4f7586a864f3c0.zip | |
account level currency and autowithdraw settings
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/users.ts | 10 |
1 files changed, 8 insertions, 2 deletions
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); |
