🔄 refactor(custom_component.py): rename list_flow_names method to list_flows for better clarity and consistency

🐛 fix(custom_component.py): fix return value of list_flows method to return the actual flow objects instead of just their names
🔥 chore(custom_component.py): remove unused build method as it is not implemented
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-25 17:12:48 -03:00
commit b76141b3df

View file

@ -147,10 +147,10 @@ class CustomComponent(Component, extra=Extra.allow):
raise ValueError(f"Flow {flow_id} not found")
return build_sorted_vertices_with_caching(data_graph)
def list_flow_names(self):
def list_flows(self):
with session_getter() as session:
flows = session.query(Flow).all()
return [flow.name for flow in flows]
return flows
def build(self):
raise NotImplementedError