use crate::{ApiResponse, error::ApiError}; use actix_web::{HttpResponse, Result, web}; use service::AppService; use session::Session; #[utoipa::path( post, path = "/api/projects/{source_project}/repos/{repo_name}/transfer", params( ("source_project" = String, Path), ("repo_name" = String, Path), ), request_body = service::project::transfer_repo::TransferRepoParams, responses( (status = 200, description = "Transfer repo to another project", body = ApiResponse), (status = 401, description = "Unauthorized"), (status = 403, description = "Forbidden"), (status = 404, description = "Not found"), ), tag = "Project" )] pub async fn project_transfer_repo( service: web::Data, session: Session, path: web::Path<(String, String)>, body: web::Json, ) -> Result { let (source_project_name, repo_name) = path.into_inner(); let resp = service .transfer_repo(&session, source_project_name, repo_name, body.into_inner()) .await?; Ok(ApiResponse::ok(resp).to_response()) }