pub async fn get_users(
__arg0: State<Arc<AppState>>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>Expand description
Retrieves all users in the system.
Only admins can call this endpoint (enforced by middleware). Returns all User records converted to FilteredUser
and sorted alphabetically by last name. Password hashes are not included in the response.
§Arguments
State(data): Application state containingAppStatefor database access
§Returns
200 OKwith array ofFilteredUserobjects500 Internal Server Errorif database query fails
§Example Response
[
{
"id": 1,
"first_name": "Admin",
"last_name": "User",
"username": "admin",
"is_admin": true
},
{
"id": 2,
"first_name": "Regular",
"last_name": "User",
"username": "regularuser",
"is_admin": false
}
]