-
Notifications
You must be signed in to change notification settings - Fork 59
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: newsletter's unsubscribe endpoint #421
Feat: newsletter's unsubscribe endpoint #421
Conversation
Is there a subscribe endpoint? |
Yes, the subscribe endpoint is POST /api/v1/pages/newsletter. (On the issue I had PATCH as the method, but I changed it to POST to match what the other teams have) |
if Subscribe is /api/v1/news-letter POST |
The dilemma is, we're asked to have a unified backend.
What approach would be considered more RESTful? I'd like to know your opinion. |
.../news-letter POST for subscribe (add resource to db) this is more RESTFUL |
} | ||
|
||
var subscriber = await _repository.GetBySpec( | ||
s => s.Email == request.SubscriptionDto.Email |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use .Trim().ToLower() to normalize the email before processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
Whats your thought on soft and hard delete? |
Both are needed, though soft delete is more common (for marketing, for archiving, for legal purposes etc). |
Description
Closes #404
Changes proposed
Check List (Check all the applicable boxes)
Screenshots/Videos
Invalid email format returns a 400 status code

Not found subscriber return 400 status code

Successful response returns a 200 status code

Tests passed
