From 50af956a331e09a5b11be7e4b17cbb63f1539a78 Mon Sep 17 00:00:00 2001 From: Zachary Hamm Date: Thu, 12 Dec 2024 13:39:11 -0600 Subject: [PATCH] fix: ignore geometry when sending deleted updates --- lib/sdf-server/src/service/diagram/delete_component.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sdf-server/src/service/diagram/delete_component.rs b/lib/sdf-server/src/service/diagram/delete_component.rs index 4c1a2f297e..f44249a20e 100644 --- a/lib/sdf-server/src/service/diagram/delete_component.rs +++ b/lib/sdf-server/src/service/diagram/delete_component.rs @@ -46,6 +46,7 @@ pub async fn delete_components( let mut components = HashMap::new(); let mut socket_map = HashMap::new(); + let mut socket_map_head = HashMap::new(); for component_id in request.component_ids { let component: Component = Component::get_by_id(&ctx, component_id).await?; let incoming_connections = component.incoming_connections(&ctx).await?.clone(); @@ -70,7 +71,7 @@ pub async fn delete_components( // to_delete=True let component: Component = Component::get_by_id(&ctx, component_id).await?; let payload = component - .into_frontend_type_for_default_view(&ctx, ChangeStatus::Deleted, &mut socket_map) + .into_frontend_type(&ctx, None, ChangeStatus::Deleted, &mut socket_map) .await?; WsEvent::component_updated(&ctx, payload) .await? @@ -80,10 +81,11 @@ pub async fn delete_components( let component: Component = Component::get_by_id(&base_change_set_ctx, component_id).await?; let payload = component - .into_frontend_type_for_default_view( + .into_frontend_type( &base_change_set_ctx, + None, ChangeStatus::Deleted, - &mut socket_map, + &mut socket_map_head, ) .await?; WsEvent::component_updated(&ctx, payload)