diff --git a/ftd/src/interpreter/main.rs b/ftd/src/interpreter/main.rs index c1610ddb5d..179c7aef18 100644 --- a/ftd/src/interpreter/main.rs +++ b/ftd/src/interpreter/main.rs @@ -1096,14 +1096,10 @@ impl Document { .collect_vec() } - pub fn get_component_by_id( - &self, - component_name: &str, - component_id: &str, - ) -> Option<&ftd::interpreter::Component> { + pub fn get_component_by_id(&self, component_id: &str) -> Option<&ftd::interpreter::Component> { self.tree.iter().find(|v| { if let Some(id) = &v.id { - return v.name.eq(component_name) && id.eq(component_id); + return id.eq(component_id); } false diff --git a/ftd/src/interpreter/test.rs b/ftd/src/interpreter/test.rs index 177898704f..789c2ec39b 100644 --- a/ftd/src/interpreter/test.rs +++ b/ftd/src/interpreter/test.rs @@ -209,7 +209,7 @@ fn test_extract_kwargs() { ) .unwrap(); - let component = doc.get_component_by_id("foo#fizz", "test").unwrap(); + let component = doc.get_component_by_id("test").unwrap(); let data = component.get_kwargs(&doc, "data").unwrap(); assert_eq!(data.get("bar"), Some(&String::from("Hello")));