Skip to content

Add Comment Reply and Deletion Endpoints #29

Description

@onlydustapp

📚 Overview

Implement two new endpoints to enhance our comment system by adding threaded replies and secure deletion capabilities:

  • POST /comments/:id/reply: This endpoint will allow users to post replies to existing comments. Replies should be threaded, meaning the relationship between original comments and replies must be maintained.

  • DELETE /comments/:id: This endpoint will enable comment deletion. Deletion should be strictly permitted only for the owner of the comment.

🛠️ Tasks and Requirements

  1. Reply Endpoint (POST /comments/:id/reply):

    • Accept a payload containing the reply text and any other necessary metadata.
    • Ensure that the reply is correctly associated with the parent comment (threaded).
    • Validate the input to ensure all required fields are provided.
  2. Deletion Endpoint (DELETE /comments/:id):

    • Verify that the request is made by the comment owner before deletion.
    • If the user is not the owner, return an appropriate error response.
    • Safely handle the deletion to avoid breaking the comment thread (consider scenarios like replies to deleted comments).

✅ Definition of Done

  • The POST /comments/:id/reply endpoint is functional and correctly threads replies.
  • The DELETE /comments/:id endpoint only allows the comment owner to delete the comment.
  • Proper error handling and response codes are implemented for invalid operations or unauthorized actions.
  • The implementation adheres to the Nest.js framework conventions as referenced in the README

⚙ Technical Considerations

  • Auth mechanisms should be in place to correctly identify the comment owner for deletion.
  • Ensure that unit and e2e tests are updated or added to cover these endpoints.
  • Follow the existing coding patterns and project structure as outlined in the project's documentation.

Let's make our comment system more interactive and user-friendly! 🚀

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions