add study flow endpoints
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user