use axum::Json; use axum::extract::{Path, State}; use axum::http::StatusCode; use jwt::extractor::AuthUser; use uuid::Uuid; use crate::error::IssueResult; use crate::features::IssueService; use crate::features::issue_repo_rel::{CreateRepoRelOption, RepoRelView}; #[utoipa::path( post, path = "/issues/{channel_id}/{issue_id}/repo_relations", tag = "issues", request_body = CreateRepoRelOption, responses((status = 201, description = "Link repo to issue", body = RepoRelView)), security(("bearer_auth" = [])) )] pub(crate) async fn handler( State(svc): State, AuthUser { claims }: AuthUser, Path((channel_id, issue_id)): Path<(Uuid, Uuid)>, Json(input): Json, ) -> IssueResult<(StatusCode, Json)> { let view = svc .create_repo_rel(claims.sub, channel_id, issue_id, input) .await?; Ok((StatusCode::CREATED, Json(view))) }