pub async fn get_user_by_id(
__arg0: Path<i16>,
__arg1: State<Arc<AppState>>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>Expand description
Retrieves a single user’s details by their ID.
This endpoint allows fetching a specific User’s information. It returns a FilteredUser
object (converted via filter_user), ensuring sensitive data like password hashes are not exposed.
§Arguments
Path(id): The ID of theUserto retrieve, extracted from the URL path.State(data): Application state containingAppStatefor database access.
§Returns
200 OKwith aFilteredUserJSON object if the user is found.404 Not Foundif a user with the given ID does not exist.500 Internal Server Errorif a database query error occurs.