7fife-backend/middlewares/Reward.js

29 lines
580 B
JavaScript
Raw Permalink Normal View History

2024-03-07 13:01:44 +00:00
const bodyCheck = async(req,res,next) => {
try{
if(!req.body.reward){
return res.status(400).send({
message : 'Provide reward value'
})
}
if(!req.body.score){
return res.status(400).send({
message : 'Provide Score value'
})
}
next();
}catch(err){
console.log('Error inside Bodycheck Middleware',err);
return res.status(500).send({
message : 'Internal Server Error'
})
}
}
module.exports = {
bodyCheck
}