我在这里找不到任何console.log。相反,我得到一个错误
Unexpected token in JSON at position 2
// api/favorite/:id
router.delete('/:id', (req, res) => {
const { user } = res.locals
console.log(user)
if (user) {
const { id } = req.params
console.log(id)
// USERS.find(({ id }) => id === user.id).favorites.filter(_id => _id !== id)
res.status(200).json({ message: 'Job successfully deleted from favorites' });
} else {
res.status(403).json({ message: 'You are not authenticated' });
}
});