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
Create an API endpoint to deactivate a registered user's account for the admin user. This endpoint will be part of the administration user management. Admin users can deactivate a user using this endpoint
Acceptance Criteria
The endpoint should be accessible at PUT /api/v1/admin/users/{id}.
The endpoint should accept HTTP PUT requests with payload.
The endpoint should deactivate a registered user's account by setting their status to deactivated from the database using the provided user's ID.
The endpoint should return a 200 OK status code with the updated user's details in the response body
This endpoint should be secured and only accessible to an admin user
GET /api/v1/admin/users/3454 Payload
To deactivate a user, the appropriate account status should be sent as payload to the endpoint
{
"status": "deactivate"
}
Response:
On a successful retrieval of the user details, the API should return a 200 OK status code. The response body should contain the user details:
Description
Create an API endpoint to deactivate a registered user's account for the admin user. This endpoint will be part of the administration user management. Admin users can deactivate a user using this endpoint
Acceptance Criteria
deactivated
from the database using the provided user's ID.GET /api/v1/admin/users/3454
Payload
To deactivate a user, the appropriate account status should be sent as payload to the endpoint
Response:
On a successful retrieval of the user details, the API should return a 200 OK status code. The response body should contain the user details:
{
"status": "success",
"status_code": 200
"data": {
"id": 3454,
"first_name": "string",
"last_name": "string",
"email": "string",
"avatar_url": "string",
"phone_number': 'string",
"status': 'deactivated",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-06-01T12:00:00Z"
}
}
Validation:
If the user's ID is missing or invalid, the API should return a 400 Bad Request status code with appropriate validation error messages:
If the user does not exist, the API should return a 404 Not Found status code with an appropriate message:
Purpose
To provide admin users with a way to deactivate a registered user's account
Requirements
Expected Outcome
API endpoint should allow admin users to deactivate a user's account by ID with appropriate validation and security measures.
Tasks:
Testing
The text was updated successfully, but these errors were encountered: