text: const router = require('express').Router();
  const { Comment } = require('../../models');
  const withAuth = require('../../utils/auth');
  
  router.post('/', withAuth, async (req, res) => {
    console.log(req.body);
    console.log(req.session.user_id);
    console.log(req.session.user_name);
    try {
      const newComment = await Comment.create({
        comment: req.body.comment,
        song_id: req.body.song_id,
        user_id: req.session.user_id,
        user_name: req.session.user_name,
      });
  
      console.log(newComment);
  
      res.status(200).json(newComment);
    } catch (err) {
      res.status(400).json(err);
    }
  });
  
  router.delete('/:id', withAuth, async (req, res) => {
    try {
      const commentData = await Comment.destroy({
        where: {
          id: req.params.id,
          user_id: req.session.user_id,
        },
      });
  
      if (!commentData) {
        res.status(404).json({ message: 'No comment found with this id!' });
        return;
      }
  
      res.status(200).json(commentData);
    } catch (err) {
      res.status(500).json(err);
    }
  });
  
  module.exports = router;