feat(InventoryStore): return a restricted view of the inventory
This commit is contained in:
@@ -2,9 +2,8 @@ from dataclasses import dataclass
|
||||
|
||||
from clan_lib.api import API
|
||||
from clan_lib.flake import Flake
|
||||
from clan_lib.nix_models.clan import Inventory
|
||||
from clan_lib.nix_models.clan import InventoryMeta as Meta
|
||||
from clan_lib.persist.inventory_store import InventoryStore
|
||||
from clan_lib.persist.inventory_store import InventorySnapshot, InventoryStore
|
||||
from clan_lib.persist.util import set_value_by_path
|
||||
|
||||
|
||||
@@ -15,7 +14,7 @@ class UpdateOptions:
|
||||
|
||||
|
||||
@API.register
|
||||
def update_clan_meta(options: UpdateOptions) -> Inventory:
|
||||
def update_clan_meta(options: UpdateOptions) -> InventorySnapshot:
|
||||
inventory_store = InventoryStore(options.flake)
|
||||
inventory = inventory_store.read()
|
||||
set_value_by_path(inventory, "meta", options.meta)
|
||||
|
||||
Reference in New Issue
Block a user