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::extras::LicensesResponse;
#[utoipa::path(
get,
path = "/repo/{channel_id}/{repo_id}/licenses",
tag = "repo",
responses((status = 200, description = "List detected licenses", body = LicensesResponse)),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<RepoService>,
AuthUser { claims }: AuthUser,
Path((_, repo_id)): Path<(Uuid, Uuid)>,
) -> RepoResult<Json<LicensesResponse>> {
let out = svc.get_licenses(claims.sub, repo_id).await?;
Ok(Json(out))
}