I can't get any console.log here. Instead, I get an error 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' });
  }
});

0 Answers