d5939db
use axum::Json;
use axum::extract::{Path, State};
use jwt::extractor::AuthUser;
use uuid::Uuid;
use crate::error::UserResult;
use crate::features::UserService;
use crate::features::profile::ProfileView;
#[utoipa::path(
get,
path = "/user/users/{uid}/profile-detail",
tag = "user",
params(
("uid" = Uuid, Path, description = "User identifier."),
),
responses(
(status = 200, description = "Extended profile record.", body = ProfileView),
(status = 404, description = "Profile not found."),
),
)]
pub(crate) async fn handler(
State(svc): State<UserService>,
_user: AuthUser,
Path(uid): Path<Uuid>,
) -> UserResult<Json<ProfileView>> {
let view = svc.get_profile(uid).await?;
Ok(Json(view))
}