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: added superadmin to deactivate user endpoint #1235

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Oguntayo
Copy link

@Oguntayo Oguntayo commented Mar 2, 2025

Description

This PR introduces an endpoint that allows a super admin to deactivate a user account by their user ID. It ensures that only super admins can perform this action and sends a notification email to the deactivated user.

Related Issue

#1031

Motivation and Context

This change is necessary to allow super admins to manage user accounts effectively, ensuring inactive users are properly handled. It improves security and account management within the system.

How Has This Been Tested?

  • Manually tested using Postman by sending a POST request to /api/v1/users/deactivate with valid and invalid user IDs.
  • Verified that only super admins can perform this action.
  • Ensured that already deactivated users cannot be deactivated again.
  • Confirmed that a notification email is sent to the user upon deactivation.
  • Ran unit tests to validate the logic.

Screenshots (if applicable)

sunday4
sunday3
sunday2
sunday1
passed

Types of Changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project.
  • My change does not require updates to the documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests 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.

1 participant