Remove render_to_sx from public API: enforce sx_call for all service code
Replace ~250 render_to_sx calls across all services with sync sx_call, converting many async functions to sync where no other awaits remained. Make render_to_sx/render_to_sx_with_env private (_render_to_sx). Add (post-header-ctx) IO primitive and shared post/post-admin defmacros. Convert built-in post/post-admin layouts from Python to register_sx_layout with .sx defcomps. Remove dead post_admin_mobile_nav_sx. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -111,19 +111,19 @@ def register():
|
||||
# Success → re-render the slots table
|
||||
slots = await svc_list_slots(g.s, g.calendar.id)
|
||||
from sxc.pages.slots import render_slots_table
|
||||
return sx_response(await render_slots_table(slots, g.calendar))
|
||||
return sx_response(render_slots_table(slots, g.calendar))
|
||||
|
||||
|
||||
@bp.get("/add")
|
||||
@require_admin
|
||||
async def add_form(**kwargs):
|
||||
from sxc.pages.slots import render_slot_add_form
|
||||
return sx_response(await render_slot_add_form(g.calendar))
|
||||
return sx_response(render_slot_add_form(g.calendar))
|
||||
|
||||
@bp.get("/add-button")
|
||||
@require_admin
|
||||
async def add_button(**kwargs):
|
||||
from sxc.pages.slots import render_slot_add_button
|
||||
return sx_response(await render_slot_add_button(g.calendar))
|
||||
return sx_response(render_slot_add_button(g.calendar))
|
||||
|
||||
return bp
|
||||
|
||||
Reference in New Issue
Block a user