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 Deactivate Profile Endpoint #182

Open
Micah-Shallom opened this issue Jul 29, 2024 · 0 comments
Open

FEAT: Implement Deactivate Profile Endpoint #182

Micah-Shallom opened this issue Jul 29, 2024 · 0 comments
Assignees
Labels

Comments

@Micah-Shallom
Copy link
Contributor

Title: Implement Deactivate Profile Endpoint

Description:

Develop and implement a new API endpoint to allow users to deactivate their profiles. Deactivation should mark the profile as inactive but should not delete any user data.

Endpoint: PATCH /api/v1/profile/deactivate

Requirements:

  1. Endpoint Definition:

    • Method: PATCH
    • URL: /api/v1/profile/deactivate
    • Authentication: Required (JWT token)
  2. Request Body:

    • No additional body parameters required.
  3. Response:

    • Success (200 OK):
      {
        "message": "Profile deactivated successfully"
      }
    • Failure:
      • 401 Unauthorized: If the user is not authenticated.
      • 500 Internal Server Error: If there is an error deactivating the profile.
  4. Error Handling:

    • Provide meaningful error messages for failures.
  5. Security Considerations:

    • Use HTTPS for all communications to protect sensitive data.
    • Ensure only authenticated users can deactivate their profiles.

Steps:

  1. Backend Implementation:

    • Create the deactivateProfileHandler function to handle the logic for deactivating the profile.
    • Authenticate the user using the JWT token.
    • Update the user's profile status to inactive in the database.
    • Return appropriate success or error responses.
  2. Testing:

    • Write unit tests for the deactivateProfileHandler.
    • Write integration tests to ensure the endpoint works as expected.
  3. Documentation:

    • Update the API documentation to include details about the new endpoint and response formats.

@Micah-Shallom Micah-Shallom self-assigned this Jul 29, 2024
@Cyberguru1 Cyberguru1 self-assigned this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants