use axum::Json; use axum::extract::{Path, State}; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::UserResult; use crate::features::UserService; #[utoipa::path( post, path = "/user/me/blocks/{uid}", tag = "user", params(("uid" = Uuid, Path, description = "Target user identifier.")), responses( (status = 200, description = "Block succeeded (idempotent; also unfollows both directions)."), (status = 404, description = "Target user not found."), ), security(("bearer_auth" = [])), )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path(uid): Path, ) -> UserResult> { svc.block_user(claims.sub, uid).await?; Ok(Json(serde_json::json!({ "ok": true }))) }