API Documentation
User Management
The User Management section in the admin panel allows administrators to search, view, block, and delete user accounts. This section provides a clear and structured approach to managing platform users efficiently.
API Endpoints
Fetch Paginated Users
- Endpoint:
GET /admin/users?page={page}&limit={limit}&search={query}
- Description: Retrieves a paginated list of users.
- Example Response:
Block a User
- Endpoint:
PUT /admin/users/block/{id}
- Description: Blocks a user, preventing them from logging in.
- Response:
Delete a User
- Endpoint:
DELETE /admin/users/{id}
- Description: Deletes a user and all associated data.
- Response:
Check User Status (Frontend Validation)
If a blocked user attempts to log in, the frontend should check their status:
Conclusion
The User Management system enables administrators to efficiently handle user access and maintain a secure platform. Blocking users prevents access without deleting their accounts, while deletion removes them permanently. The API allows dynamic control over user management processes.
For any issues, administrators should ensure users are correctly categorized and that API responses are handled appropriately.