Add glue layer: MenuNode replaces MenuItem, remove /internal/menu-items API
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m4s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m4s
- Context processor: get_navigation_tree() replaces get_all_menu_items() - Menu admin service: MenuItem → MenuNode (container_type/container_id pattern) - Remove /internal/menu-items endpoint (other apps query menu_nodes directly) - Remove menu_items relationship from Post model - Templates: item.post.X → item.X - Add glue submodule Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7
app.py
7
app.py
@@ -24,17 +24,16 @@ async def coop_context() -> dict:
|
||||
"""
|
||||
Coop app context processor.
|
||||
|
||||
- menu_items: direct DB query (coop owns this data)
|
||||
- menu_items: direct DB query via glue layer
|
||||
- cart_count/cart_total: fetched from cart internal API
|
||||
"""
|
||||
from shared.infrastructure.context import base_context
|
||||
from bp.menu_items.services.menu_items import get_all_menu_items
|
||||
from glue.services.navigation import get_navigation_tree
|
||||
from shared.infrastructure.internal_api import get as api_get
|
||||
|
||||
ctx = await base_context()
|
||||
|
||||
# Coop owns menu_items — query directly
|
||||
ctx["menu_items"] = await get_all_menu_items(g.s)
|
||||
ctx["menu_items"] = await get_navigation_tree(g.s)
|
||||
|
||||
# Cart data from cart app API
|
||||
cart_data = await api_get("cart", "/internal/cart/summary", forward_session=True)
|
||||
|
||||
Reference in New Issue
Block a user