fix
This commit is contained in:
parent
e3128d7214
commit
9468629302
2 changed files with 26 additions and 18 deletions
|
@ -156,6 +156,10 @@ pub async fn end_flow_route(id: &str, form: Json<EndFlow>) -> FallibleApiRespons
|
||||||
.await
|
.await
|
||||||
.ok_or_else(|| api_error("Flow not found"))?;
|
.ok_or_else(|| api_error("Flow not found"))?;
|
||||||
|
|
||||||
|
if flow.done.is_some() {
|
||||||
|
return Err(api_error("Flow already ended"));
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(produced) = &form.produced {
|
if let Some(produced) = &form.produced {
|
||||||
let prod = flow.end_with_produce(produced).await?;
|
let prod = flow.end_with_produce(produced).await?;
|
||||||
Ok(json!({"produced": prod}))
|
Ok(json!({"produced": prod}))
|
||||||
|
@ -175,6 +179,10 @@ pub async fn continue_flow_route(
|
||||||
.await
|
.await
|
||||||
.ok_or_else(|| api_error("Flow not found"))?;
|
.ok_or_else(|| api_error("Flow not found"))?;
|
||||||
|
|
||||||
|
if this_flow.done.is_some() {
|
||||||
|
return Err(api_error("Flow already ended"));
|
||||||
|
}
|
||||||
|
|
||||||
// create next flow
|
// create next flow
|
||||||
let next_kind = flows
|
let next_kind = flows
|
||||||
.get(this_flow.kind.id())
|
.get(this_flow.kind.id())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue