Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Implement Endpoint for Updating a Comment on a Blog #432

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

YastecHub
Copy link

@YastecHub YastecHub commented Mar 1, 2025

Description

**Closes #406 **

Changes proposed

What were you told to do?

Implement the Update Comment Endpoint to allow users to modify their own comments while enforcing authorization checks.

What did you do?

  • I Create UpdateCommentDto class to structure incoming update requests.
  • Created UpdateCommentCommandHandler to handle update logic.
  • Added authorization checks to ensure only the comment owner can modify their comment.
  • Implemented proper response handling for unauthorized access (403) and non-existent comments (404).
  • Added a new CommentsController to handle the update logic via API endpoints.
  • Added unit tests in UpdateCommentCommandShould.cs to verify different cases.
  • Added an UpdatedAt column to track when a comment is modified.

Check List (Check all the applicable boxes)

🚨Please review the contribution guideline for this repository.

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the dev branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots/Vi

HNG01
HNG02
HNG03
deos
HNG04
HNG06

Copy link
Contributor

@Heba-WebDev Heba-WebDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@Fabito97
Copy link
Contributor

Fabito97 commented Mar 1, 2025

Yes, this is good.

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.

[Feat] Implement Endpoint for Updating a Comment on a Blog
3 participants