){returnres.status(400).send("Malformed body or missing body data. Make sure you have all the required parameters, and you don't have illegal characters present.");}
){returnres.status(400).send("Malformed body or missing body data. Make sure you have all the required parameters, and you don't have illegal characters present.");}
if(e){req.authenticatedUser=undefined;returnpassAuth?next():res.status(401).send("You are not authenticated!");}
if(e){req.user=undefined;returnpassAuth?next():res.status(401).send("You are not authenticated!");}
Users.findOne({id:d.id})
Users.findOne({id:d.id})
.exec((err,user)=>{
.exec((err,user)=>{
if(err){res.status(500).send("Something went trying to authorize you!");}
if(err){res.status(500).send("Something went trying to authorize you!");}
else{req.authenticatedUser=user;next();}
else{req.user=user;next();}
});
});
});
});
}else{req.authenticatedUser=undefined;returnpassAuth?next():res.status(401).send("You are not authenticated; you did not send your request with any authentication headers.");}
returnreq.listData.length===length?res.status(500).send("For some reason, that couldn't be removed."):awaitsave(req,res,req.listData)||res.json(req.listData);
returnreq.listData.length===length?res.status(500).send("For some reason, that couldn't be removed."):awaitsave(req,res,req.listData)||res.json(req.listData);