diff options
| author | Adam Soltys <[email protected]> | 2023-11-28 09:50:58 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-11-28 09:51:00 -0800 |
| commit | 644a003e4609f610343805a08f1cd5ed81d85b96 (patch) | |
| tree | 1ddd4b5212650c0b365e2f73ab3006a7e6652242 | |
| parent | 63f50dcba44a1b6b1ca45243bc22d5f5625f27f0 (diff) | |
| download | coinos-server-644a003e4609f610343805a08f1cd5ed81d85b96.tar.gz coinos-server-644a003e4609f610343805a08f1cd5ed81d85b96.zip | |
re-order contacts
| -rw-r--r-- | routes/users.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/routes/users.js b/routes/users.js index 75bff8b5..af9a036d 100644 --- a/routes/users.js +++ b/routes/users.js @@ -356,9 +356,9 @@ export default { payments.reverse().map(async (id) => await g(`payment:${id}`)) ) ).filter((p) => p.type === types.internal && p.ref)) { - if (!~contacts.findIndex(({ id }) => id === ref)) { - contacts.unshift(await g(`user:${ref}`)); - } + let i = contacts.findIndex(({ id }) => id === ref) + if (~i) contacts.splice(i, 1); + contacts.unshift(await g(`user:${ref}`)); } await s(`${id}:contacts`, contacts); @@ -409,6 +409,11 @@ export default { } }, + async printerlogin({ body: { username, topic } }, res) { + if (username === topic) res.send({ ok: true }); + else bail(res, "unauthorized"); + }, + async acl({ body: { username, topic } }, res) { if (username === topic) res.send({ ok: true }); else bail(res, "unauthorized"); |
