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::devices::{DeviceView, UpdateDeviceCmd}; #[utoipa::path( patch, path = "/user/me/devices/{id}", tag = "user", params(("id" = Uuid, Path, description = "Device identifier.")), request_body = UpdateDeviceCmd, responses( (status = 200, description = "Device updated.", body = DeviceView), ), security(("bearer_auth" = [])), )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path(id): Path, Json(cmd): Json, ) -> UserResult> { Ok(Json(svc.update_device(claims.sub, id, cmd).await?)) }