a06673b
use axum::extract::{Path, State};
use axum::http::StatusCode;
use jwt::extractor::AuthUser;
use uuid::Uuid;
use crate::error::RepoResult;
use crate::features::RepoService;
#[utoipa::path(
delete,
path = "/repo/{channel_id}/{repo_id}",
tag = "repo",
responses((status = 204, description = "Delete a repository")),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<RepoService>,
AuthUser { claims }: AuthUser,
Path((channel_id, repo_id)): Path<(Uuid, Uuid)>,
) -> RepoResult<StatusCode> {
svc.delete_repo(claims.sub, channel_id, repo_id).await?;
Ok(StatusCode::NO_CONTENT)
}