diff --git a/.gitmodules b/.gitmodules index b509b5a..9ead19f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = shared url = https://git.rose-ash.com/coop/shared.git branch = decoupling +[submodule "glue"] + path = glue + url = /root/rose-ash/glue diff --git a/app.py b/app.py index dea4053..e6abe30 100644 --- a/app.py +++ b/app.py @@ -40,13 +40,13 @@ async def cart_context() -> dict: - cart / calendar_cart_entries / total / calendar_total: direct DB (cart app owns this data) - cart_count: derived from cart + calendar entries (for _mini.html) - - menu_items: fetched from coop internal API + - menu_items: direct DB query via glue layer When g.page_post exists, cart and calendar_cart_entries are page-scoped. Global cart_count / cart_total stay global for cart-mini. """ from shared.infrastructure.context import base_context - from shared.infrastructure.internal_api import get as api_get, dictobj + from glue.services.navigation import get_navigation_tree ctx = await base_context() @@ -75,9 +75,7 @@ async def cart_context() -> dict: ctx["total"] = total ctx["calendar_total"] = calendar_total - # Menu items from coop API (wrapped for attribute access in templates) - menu_data = await api_get("coop", "/internal/menu-items") - ctx["menu_items"] = dictobj(menu_data) if menu_data else [] + ctx["menu_items"] = await get_navigation_tree(g.s) return ctx diff --git a/glue b/glue new file mode 160000 index 0000000..f57c765 --- /dev/null +++ b/glue @@ -0,0 +1 @@ +Subproject commit f57c765cac299b32b66b08c99c2c6a85ca52e0ea