Skip to content

Commit

Permalink
flow: fix bug (checkout mpdel template) (#843)
Browse files Browse the repository at this point in the history
* flow: fix bug (modify states)

* flow: fix bug (checkout mpdel template)
  • Loading branch information
ZzIsGod1019 authored Sep 10, 2024
1 parent b13dcb7 commit 74a19ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/middlewares/flow/src/api/ci/flow_ci_model_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl FlowCiModelApi {
check_without_owner_and_unsafe_fill_ctx(request, &funs, &mut ctx.0)?;
funs.begin().await?;
warn!("ci copy_or_reference_model req: {:?}", req.0);
let orginal_models = FlowModelServ::clean_rel_models(None, None, None, &funs, &ctx.0).await?;
let _orginal_models = FlowModelServ::clean_rel_models(None, None, None, &funs, &ctx.0).await?;
// find rel models
let rel_model_ids = FlowRelServ::find_to_simple_rels(
&FlowRelKind::FlowModelTemplate,
Expand Down
4 changes: 2 additions & 2 deletions backend/middlewares/flow/src/api/ct/flow_ct_model_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl FlowCtModelApi {
.await?;
}
FlowInstServ::batch_update_when_switch_model(
new_model.rel_template_ids.first().cloned(),
req.0.rel_template_id.clone(),
&new_model.tag,
&new_model.id,
new_model.states.clone(),
Expand Down Expand Up @@ -103,7 +103,7 @@ impl FlowCtModelApi {
) -> TardisApiResult<HashMap<String, FlowModelAggResp>> {
let mut funs = flow_constants::get_tardis_inst();
funs.begin().await?;
let orginal_models = FlowModelServ::clean_rel_models(Some(to_template_id.0.clone()), None, None, &funs, &ctx.0).await?;
let _orginal_models = FlowModelServ::clean_rel_models(Some(to_template_id.0.clone()), None, None, &funs, &ctx.0).await?;
let mut result = HashMap::new();
for from_model in FlowModelServ::find_detail_items(
&FlowModelFilterReq {
Expand Down
9 changes: 8 additions & 1 deletion backend/middlewares/flow/src/serv/flow_inst_serv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,14 @@ impl FlowInstServ {
..Default::default()
};
funs.db().update_one(flow_inst, &mock_ctx).await.unwrap();
let model_tag = FlowModelServ::get_item(modify_model_id, &FlowModelFilterReq::default(), funs, ctx).await.map(|detail| detail.tag);
let model_tag = FlowModelServ::get_item(modify_model_id, &FlowModelFilterReq {
basic: RbumBasicFilterReq {
own_paths: Some("".to_string()),
with_sub_own_paths: true,
..Default::default()
},
..Default::default()
}, funs, ctx).await.map(|detail| detail.tag);
let next_flow_state = FlowStateServ::get_item(
state_id,
&FlowStateFilterReq {
Expand Down

0 comments on commit 74a19ae

Please sign in to comment.