Skip to content
Clone
a06673b
24 lines 685 B Rust
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::UserMini;
#[utoipa::path(
get,
path = "/repo/{channel_id}/{repo_id}/reviewers",
tag = "repo",
responses((status = 200, description = "List reviewers", body = Vec<UserMini>)),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<RepoService>,
AuthUser { claims }: AuthUser,
Path((_, repo_id)): Path<(Uuid, Uuid)>,
) -> RepoResult<Json<Vec<UserMini>>> {
let out = svc.list_reviewers(claims.sub, repo_id).await?;
Ok(Json(out))
}