use std::sync::Arc; use axum::extract::{Path, State}; use crate::api::Api; use crate::web::{ApiResult, not_found, ok}; pub async fn list_plans(State(api): State>) -> ApiResult { ok(api.query.list_plans()) } pub async fn get_plan(State(api): State>, Path(id): Path) -> ApiResult { match api.query.get_plan(&id) { Some(plan) => ok(plan), None => Err(not_found("plan not found")), } }