From 6799fb647197832813557492310ad89acfa52eca Mon Sep 17 00:00:00 2001 From: Gamal Ahmed <75225936+gamalahmed3265@users.noreply.github.com> Date: Sat, 7 Oct 2023 11:25:47 +0300 Subject: [PATCH] Change res to req in Comment Controller --- server/controllers/comment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.");