Skip to content

Commit 5324a42

Browse files
committed
modify delete a comment function
1 parent 907581d commit 5324a42

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/controllers/activity.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const updateComment = async (req, res) => {
294294
const deleteComment = async (req, res) => {
295295
try {
296296
const user = req.user;
297-
const { commentId } = req.params; // get comment id from url
297+
const { commentId } = req.params;
298298

299299
const comment = await Comment.findByPk(commentId);
300300
if (!comment) {
@@ -305,7 +305,7 @@ const deleteComment = async (req, res) => {
305305

306306
if (comment.user_id !== user.id) {
307307
return res.status(403).json({
308-
message: "You can only delete your own comments",
308+
message: "Not authorized to delete this comment",
309309
});
310310
}
311311

0 commit comments

Comments
 (0)