use axum::extract::{Path, State}; use export::rest::{AppResponseData, NoData}; use session::Session; use crate::errors::{ApiError, GitApiError}; use crate::handler::require_writer; use crate::service::GitService; #[derive(Debug, Clone, serde::Deserialize)] pub struct RefPath { pub space_name: String, pub repo_name: String, pub name: String, } pub async fn refs_delete( State(service): State, session: Session, Path(path): Path, ) -> Result, ApiError> { let _ = require_writer(&service, &session, path.space_name.clone(), path.repo_name.clone()).await?; service .refs_delete(path.space_name, path.repo_name, path.name) .await .map_err(GitApiError::from)?; Ok(AppResponseData::ok(NoData)) }