mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-23 20:42:16 +00:00
Allow falsy values for force_change and Is_active in PUT user call (#95)
* allow falsy values * apply review comments Co-authored-by: eglehelms <e.helms@cognigy.com>
This commit is contained in:
@@ -305,12 +305,12 @@ router.put('/:user_sid', async(req, res) => {
|
||||
if (0 === r.changedRows) throw new Error('database update failed');
|
||||
}
|
||||
|
||||
if (is_active) {
|
||||
if (typeof is_active !== 'undefined') {
|
||||
const r = await promisePool.execute('UPDATE users SET is_active = ? WHERE user_sid = ?', [is_active, user_sid]);
|
||||
if (0 === r.changedRows) throw new Error('database update failed');
|
||||
}
|
||||
|
||||
if (force_change) {
|
||||
if (typeof force_change !== 'undefined') {
|
||||
const r = await promisePool.execute(
|
||||
'UPDATE users SET force_change = ? WHERE user_sid = ?',
|
||||
[force_change, user_sid]);
|
||||
|
||||
Reference in New Issue
Block a user