swarm-controller: git_forge read handlers take a forge-only sub-state
This commit is contained in:
parent
b184f4e096
commit
52bfca85ad
1 changed files with 37 additions and 10 deletions
|
|
@ -10,8 +10,9 @@ use axum::{
|
|||
};
|
||||
|
||||
use crate::forge;
|
||||
use crate::git_forge::GitForgeState;
|
||||
use crate::issue_report::issue_report_error_status;
|
||||
use crate::routes::{AppState, error_problem};
|
||||
use crate::routes::error_problem;
|
||||
|
||||
/// The 503 detail when the forge did not answer within
|
||||
/// [`forge::FORGE_DEADLINE`].
|
||||
|
|
@ -28,7 +29,7 @@ const DEADLINE_DETAIL: &str = "the forge did not answer within the deadline";
|
|||
tag = "pulls"
|
||||
)]
|
||||
pub async fn get_pr_report_all(
|
||||
State(state): State<AppState>,
|
||||
State(state): State<GitForgeState>,
|
||||
) -> Result<Json<Vec<forge::pr_report::PrReportRow>>, problem_details::ProblemDetails> {
|
||||
let Some(client) = state.forge.get() else {
|
||||
return Err(error_problem(
|
||||
|
|
@ -74,7 +75,7 @@ pub async fn get_pr_report_all(
|
|||
tag = "pulls"
|
||||
)]
|
||||
pub async fn get_pr_report(
|
||||
State(state): State<AppState>,
|
||||
State(state): State<GitForgeState>,
|
||||
Path((org, repo)): Path<(String, String)>,
|
||||
) -> Result<Json<Vec<forge::pr_report::PrReportRow>>, problem_details::ProblemDetails> {
|
||||
let Some(client) = state.forge.get() else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue