Migrate callers from attach-child/detach-child to relate/unrelate API
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m18s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m18s
Switch all cross-service relation calls to the new registry-aware relate/unrelate/can-relate actions, and consolidate per-service container-nav fragment fetches into the generic relations handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,7 +103,7 @@ def register(url_prefix, title):
|
||||
from shared.infrastructure.cart_identity import current_cart_identity
|
||||
from shared.infrastructure.data_client import fetch_data
|
||||
from shared.contracts.dtos import CartSummaryDTO, dto_from_dict
|
||||
from shared.infrastructure.fragments import fetch_fragment, fetch_fragments
|
||||
from shared.infrastructure.fragments import fetch_fragment
|
||||
|
||||
p_data = await _post_data("home", g.s, include_drafts=False)
|
||||
if not p_data:
|
||||
@@ -116,22 +116,12 @@ def register(url_prefix, title):
|
||||
db_post_id = p_data["post"]["id"]
|
||||
post_slug = p_data["post"]["slug"]
|
||||
|
||||
# Fetch container nav fragments from events + market
|
||||
paginate_url = url_for(
|
||||
'blog.post.widget_paginate',
|
||||
slug=post_slug, widget_domain='calendar',
|
||||
)
|
||||
nav_params = {
|
||||
# Fetch container nav from relations service
|
||||
container_nav_html = await fetch_fragment("relations", "container-nav", params={
|
||||
"container_type": "page",
|
||||
"container_id": str(db_post_id),
|
||||
"post_slug": post_slug,
|
||||
"paginate_url": paginate_url,
|
||||
}
|
||||
events_nav_html, market_nav_html = await fetch_fragments([
|
||||
("events", "container-nav", nav_params),
|
||||
("market", "container-nav", nav_params),
|
||||
])
|
||||
container_nav_html = events_nav_html + market_nav_html
|
||||
})
|
||||
|
||||
ctx = {
|
||||
**p_data,
|
||||
|
||||
Reference in New Issue
Block a user