🚀 feat(custom_component.py): add method list_flow_names() to retrieve a list of flow names from the database

🐛 fix(custom_component.py): remove unused build() method to improve code cleanliness and avoid confusion
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-21 23:15:53 -03:00
commit cf688adf53

View file

@ -147,5 +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):
with session_getter() as session:
flows = session.query(Flow).all()
return [flow.name for flow in flows]
def build(self):
raise NotImplementedError