i am having trouble making a patch request
i am logging the req.body but it is turn to an empty object.Also if my code is wrong please help me create a route. here is my code:
app.patch('/update/:_id', async (req, res) => {
console.log(req.body) //-- sends {}
try {
await LogInCollection.findByIdAndUpdate(req.params._id,{ $set:{name : req.body.name}}, {new : true});
res.status(200).send('it worked')Ï
} catch (error) {
res.status(404).send(req.body)
}
})