Finished up with global user bans.
This commit is contained in:
parent
26df91262f
commit
8fc699924e
13 changed files with 180 additions and 37 deletions
|
|
@ -65,14 +65,8 @@ module.exports.delete = async function(req, res){
|
|||
const validResult = validationResult(req);
|
||||
if(validResult.isEmpty()){
|
||||
const {user} = matchedData(req);
|
||||
const userDB = await userModel.findOne({user});
|
||||
|
||||
if(userDB == null){
|
||||
res.status(400);
|
||||
return res.send({errors:[{type: "Bad Query", msg: "User not found.", date: new Date()}]});
|
||||
}
|
||||
|
||||
await banModel.unbanByUserDoc(userDB);
|
||||
await banModel.unban({user});
|
||||
|
||||
res.status(200);
|
||||
return res.send(await banModel.getBans());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue