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: remove a subscriber from the newsletter #424

Conversation

Heba-WebDev
Copy link
Contributor

@Heba-WebDev Heba-WebDev commented Feb 27, 2025

Description

Closes #404

Changes proposed

  • Added IsDeleted to NewsLetterSubscriber entity for soft deletion
  • Created a migration to apply the IsDeleted column to the database
  • Added a base response dto in Hng.Application project under Shared/Dto folder to serve as a general response for both success and failure responses.
  • Added DELETE /api/v1/news-letter/:id endpoint to Newsletter controller
  • Created a command and a command handler in the Hng.Application project to handle the interface and logic of the endpoint
  • Added unit tests for the command handler in the Hng.Application.Test project

Check List (Check all the applicable boxes)

  • 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/Videos

  • IsDeleted added after migration
    Screenshot 2025-02-28 at 2 02 24 AM
    Screenshot 2025-02-28 at 2 06 00 AM
  • Successful response
    Screenshot 2025-02-28 at 2 11 25 AM
  • Bad request returned for invalid id format (Guid)
    Screenshot 2025-02-28 at 2 11 40 AM
  • All tests passing
    Screenshot 2025-02-28 at 2 12 52 AM

@samuelogboye
Copy link

Nice implementation.

I noticed you deleted the initial PR and made another one.

You should'nt do this again.
This means all initial reviews wont be visible in this PR.

When you get on projects, ensure all mistakes are rectified, dont delete issue, PR, Branch.

there are ways in which you can modify your implementation.

Thats is why its Version Control System

@samuelogboye
Copy link

LGTM

@Heba-WebDev
Copy link
Contributor Author

Noted. For next time, I'll make my changes in the same PR.

@incredible-phoenix246 incredible-phoenix246 merged commit 04d2854 into hngprojects:dev Mar 1, 2025
1 check passed
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 Unsubscribe Endpoint for Newsletter
3 participants