Skip to content

Added a new comment feature ( roll no : 10393) - #64

Open
saumyajain03 wants to merge 1 commit into
mrinal1224:mainfrom
saumyajain03:feature/my-new-feature
Open

Added a new comment feature ( roll no : 10393)#64
saumyajain03 wants to merge 1 commit into
mrinal1224:mainfrom
saumyajain03:feature/my-new-feature

Conversation

@saumyajain03

Copy link
Copy Markdown

Overview

Implemented a new comment feature for the Social-Media-A backend. This allows users to add, view, and delete comments on posts.

Changes Made

  • Created models/commentModel.js for storing comments linked to posts and users.
  • Added controllers/commentController.js with endpoints to create, get, and delete comments.
  • Set up routes/commentRoutes.js to handle POST, GET, and DELETE requests for comments.
  • Registered comment routes in the main app file.
  • Ensured authentication is required for adding and deleting comments.

Usage

  • POST /api/comments/:postId to add a comment.
  • GET /api/comments/:postId to retrieve all comments for a post.
  • DELETE /api/comments/:commentId to remove a comment (requires authentication).

Reference

Feature implementation structure follows existing post routes and controllers for consistency.

For Class Participation

This PR completes the required backend feature addition for comments, making the project more interactive.

@saumyajain03 saumyajain03 changed the title Added a new comment featureadded new comment feature Added a new comment feature ( roll no : 10393) Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant