Controller for deletion


PHOTO EMBED

Thu Apr 30 2020 06:35:49 GMT+0000 (UTC)

Saved by @easterEGG #nodejs

                                exports.removeById = (req, res) => {
   UserModel.removeById(req.params.userId)
       .then((result)=>{
           res.status(204).send({});
       });
};

                                
content_copyCOPY

https://www.toptal.com/nodejs/secure-rest-api-in-nodejs