diff --git a/server/controllers/comment.js b/server/controllers/comment.js index 2a73b1310a..2e1df8f46e 100644 --- a/server/controllers/comment.js +++ b/server/controllers/comment.js @@ -14,8 +14,8 @@ export const addComment = async (req, res, next) => { export const deleteComment = async (req, res, next) => { try { - const comment = await Comment.findById(res.params.id); - const video = await Video.findById(res.params.id); + const comment = await Comment.findById(req.params.id); + const video = await Video.findById(req.params.id); if (req.user.id === comment.userId || req.user.id === video.userId) { await Comment.findByIdAndDelete(req.params.id); res.status(200).json("The comment has been deleted.");