Refactor(api/list_machines): rename from list_inv_machines

This commit is contained in:
Johannes Kirschbauer
2025-06-09 13:32:08 +02:00
parent 155f3721eb
commit 0b6bc81efe
5 changed files with 18 additions and 18 deletions

View File

@@ -10,6 +10,18 @@ from clan_lib.persist.inventory_store import InventoryStore
from clan_lib.persist.util import set_value_by_path
@API.register
def list_machines(flake: Flake) -> dict[str, InventoryMachine]:
"""
List machines in the inventory for the UI.
"""
inventory_store = InventoryStore(flake=flake)
inventory = inventory_store.read()
machine = inventory.get("machines", {})
return machine
@API.register
def get_machine(flake: Flake, name: str) -> InventoryMachine:
inventory_store = InventoryStore(flake=flake)