diff --git a/src/main.rs b/src/main.rs index ef8bbc3..1095c1d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,8 @@ async fn rocket() -> _ { routes::item::move_transaction_route, routes::item::variant_price_latest_by_origin, routes::item::item_stat_route, - routes::flow::active_flows_route + routes::flow::active_flows_route, + routes::flow::flow_api_route ], ) .manage(itemdb) diff --git a/src/routes/flow.rs b/src/routes/flow.rs index d2a3dea..7ac2600 100644 --- a/src/routes/flow.rs +++ b/src/routes/flow.rs @@ -142,6 +142,14 @@ pub async fn create_flow_route( Ok(json!({"uuid": flow._id })) } +#[get("/flow/")] +pub async fn flow_api_route(id: &str, flows: &State>) -> FallibleApiResponse { + let flow = Flow::get(id) + .await + .ok_or_else(|| api_error("No such flow"))?; + Ok(flow.api().await) +} + #[post("/flow//end", data = "
")] pub async fn end_flow_route(id: &str, form: Json) -> FallibleApiResponse { let flow = Flow::get(id)