This commit is contained in:
syuilo 2018-08-21 01:03:58 +09:00
parent f0d818de24
commit 30444e5f1a
3 changed files with 6 additions and 1 deletions

View file

@ -34,6 +34,10 @@ export default (params: any) => new Promise(async (res, rej) => {
return rej('user not found');
}
if (user.isAdmin) {
return rej('cannot suspend admin');
}
await User.findOneAndUpdate({
_id: user._id
}, {