Files
hermes/backend/src/routes/results.rs
T
2026-04-09 15:17:08 +02:00

16 lines
458 B
Rust

use axum::{extract::{Extension, Path}, Json};
use uuid::Uuid;
use crate::{app_state::{AppState, SettlementSnapshot}, error::AppError};
pub async fn show(
Path(event_id): Path<Uuid>,
Extension(state): Extension<AppState>,
) -> Result<Json<SettlementSnapshot>, AppError> {
let Some(settlement) = state.settlement_for_event(event_id).await else {
return Err(AppError::not_found("Settlement not found"));
};
Ok(Json(settlement))
}