use axum::Json; use axum::extract::{Path, State}; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::RepoResult; use crate::features::RepoService; use crate::features::lifecycle::{RenameRepoOption, RepoView}; #[utoipa::path( post, path = "/repo/{channel_id}/{repo_id}/rename", tag = "repo", request_body = RenameRepoOption, responses((status = 200, description = "Rename a repository", body = RepoView)), security(("bearer_auth" = [])) )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path((channel_id, repo_id)): Path<(Uuid, Uuid)>, Json(input): Json, ) -> RepoResult> { let view = svc .rename_repo(claims.sub, channel_id, repo_id, input) .await?; Ok(Json(view)) }