Sir,
How do we implement patch and delete in javascript, any example would help. I did something like this:
todo.delete(’/:id’, (req, res) => {
arr.splice(req.params.id-1, 1)
res.send(arr)
})
todo.patch(’/:id’, (req, res) => {
arr.splice(req.params.id-1, 1)
arr.push({
task: req.body.task,
done: req.body.done
})
res.send(arr)
})