add flow api route
This commit is contained in:
parent
65bfb5f8e2
commit
9135c2f913
2 changed files with 10 additions and 1 deletions
|
@ -142,6 +142,14 @@ pub async fn create_flow_route(
|
|||
Ok(json!({"uuid": flow._id }))
|
||||
}
|
||||
|
||||
#[get("/flow/<id>")]
|
||||
pub async fn flow_api_route(id: &str, flows: &State<JSONStore<FlowInfo>>) -> FallibleApiResponse {
|
||||
let flow = Flow::get(id)
|
||||
.await
|
||||
.ok_or_else(|| api_error("No such flow"))?;
|
||||
Ok(flow.api().await)
|
||||
}
|
||||
|
||||
#[post("/flow/<id>/end", data = "<form>")]
|
||||
pub async fn end_flow_route(id: &str, form: Json<EndFlow>) -> FallibleApiResponse {
|
||||
let flow = Flow::get(id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue