From 4dbe7af9dbfc12af07a3e9ca9504573fc0de9c0b Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:44:43 +0700 Subject: [PATCH] fix list registered user does not have registered_status field (#268) --- lib/routes/api/accounts.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/routes/api/accounts.js b/lib/routes/api/accounts.js index d84b29c..0f0a815 100644 --- a/lib/routes/api/accounts.js +++ b/lib/routes/api/accounts.js @@ -187,13 +187,12 @@ router.post('/:sid/RegisteredSipUsers', async(req, res) => { name: u, contact: null, expiryTime: 0, - protocol: null, - registered_status: 'inactive' + protocol: null }; - delete user.sbcAddress; ret.push({ name: u, - ...user + ...user, + registered_status: user.expiryTime > 0 ? 'active' : 'inactive', }); } res.status(200).json(ret);