diff --git a/lib/routes/api/users.js b/lib/routes/api/users.js index 901630c..665594b 100644 --- a/lib/routes/api/users.js +++ b/lib/routes/api/users.js @@ -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]);