From 644a003e4609f610343805a08f1cd5ed81d85b96 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 28 Nov 2023 09:50:58 -0800 Subject: re-order contacts --- routes/users.js | 11 ++++++++--- 1 file 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"); -- cgit v1.2.3