You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Develop an endpoint to handle requests for unsubscribing from the newsletter. The endpoint will accept an email address, validate and sanitize it, and handle both successful and failed validations appropriately. If the email passes validation, it will be soft deleted in the database (e.g., marked as inactive or deleted) without removing the record entirely. The client will receive a 200 upon successful unsubscription. If the email is invalid or not found, an appropriate error message and status code will be returned.
Description
Develop an endpoint to handle requests for unsubscribing from the newsletter. The endpoint will accept an email address, validate and sanitize it, and handle both successful and failed validations appropriately. If the email passes validation, it will be soft deleted in the database (e.g., marked as inactive or deleted) without removing the record entirely. The client will receive a 200 upon successful unsubscription. If the email is invalid or not found, an appropriate error message and status code will be returned.
Acceptance Criteria
Requirements
Endpoint:
Method: PATCH
URL: /api/v1/pages/newsletter/
Headers: content-type: application/json
Request Body:
Responses:
Successful response
Error response
Unit tests
To validates User's email.
To ensure data is marked as removed correctly in the database.
To ensure the appropriate response and status code is returned.
The text was updated successfully, but these errors were encountered: