mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-02-22 13:19:05 +00:00
fix: /users/edit throw with empty edits
This commit is contained in:
parent
2b6fd37ba1
commit
ff7ec4aeaf
@ -355,6 +355,10 @@ self.editUser = async (req, res) => {
|
||||
update.password = await bcrypt.hash(password, saltRounds)
|
||||
}
|
||||
|
||||
if (!Object.keys(update).length) {
|
||||
throw new ClientError('You are not editing any properties of this user.')
|
||||
}
|
||||
|
||||
await utils.db.table('users')
|
||||
.where('id', id)
|
||||
.update(update)
|
||||
|
Loading…
Reference in New Issue
Block a user