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
Description
This issue will implement an API endpoint to reactivate a previously deactivated user's account for the admin user. This endpoint will be part of the administration user management. Admin users will be able to reactivate a user using this endpoint.
** Criteria**
The endpoint will be accessible at PUT /api/v1/admin/users/{id}.
The endpoint will accept HTTP PUT requests with a payload.
The endpoint will reactivate a previously deactivated user's account by updating their status to active in the database using the provided user ID.
The endpoint will return a 200 OK status code with the updated user's details in the response body.
This endpoint will be secured and only accessible to an admin user.
Payload
To reactivate a user, the appropriate account status will be sent as a payload to the endpoint:
{
"status": "activate"
}
Response
On successful reactivation of the user, the API will return a 200 OK status code. The response body will contain the user details:
If the user's ID is missing or invalid, the API will return a 400 Bad Request status code with an appropriate validation error message:
{
"status": "unsuccessful",
"status_code": 400,
"message": "Valid user ID must be provided"
}
If the user does not exist, the API will return a 404 Not Found status code with an appropriate message:
{
"status": "unsuccessful",
"status_code": 404,
"message": "User not found"
}
Purpose
This endpoint will provide admin users with a way to reactivate a previously deactivated user’s account.
Requirements
Develop server-side logic to retrieve user details by ID.
Securely handle the retrieval and reactivation process while complying with security standards.
Ensure the user’s ID is validated and handled correctly.
Expected Outcome
The API endpoint will allow admin users to reactivate a user's account by ID with appropriate validation and security measures.
Tasks
Define the PUT /api/v1/admin/users/{id} route in the server-side application.
Validate that the user’s ID is provided and is in a valid format.
Implement logic to reactivate the user's account in the database using the provided user ID.
Return the updated user details in the response body if the ID is valid and the user exists.
Handle cases where the user’s ID is invalid or the user does not exist, providing appropriate error messages.
Testing
Write unit tests to validate input validation and user reactivation logic.
Write integration tests to ensure end-to-end functionality.
Perform security testing to ensure data protection and compliance.
The text was updated successfully, but these errors were encountered:
Description
This issue will implement an API endpoint to reactivate a previously deactivated user's account for the admin user. This endpoint will be part of the administration user management. Admin users will be able to reactivate a user using this endpoint.
** Criteria**
Payload
To reactivate a user, the appropriate account status will be sent as a payload to the endpoint:
Response
On successful reactivation of the user, the API will return a 200 OK status code. The response body will contain the user details:
Validation
If the user's ID is missing or invalid, the API will return a 400 Bad Request status code with an appropriate validation error message:
If the user does not exist, the API will return a 404 Not Found status code with an appropriate message:
Purpose
This endpoint will provide admin users with a way to reactivate a previously deactivated user’s account.
Requirements
Expected Outcome
The API endpoint will allow admin users to reactivate a user's account by ID with appropriate validation and security measures.
Tasks
Testing
Write unit tests to validate input validation and user reactivation logic.
Write integration tests to ensure end-to-end functionality.
Perform security testing to ensure data protection and compliance.
The text was updated successfully, but these errors were encountered: