refactor(backend): clean up router registration pattern
Issue #6: Multiple routers per file made main.py verbose. Changes: - Add 'routers' list export to booking.py and invites.py - Update main.py to iterate over router lists for multi-router modules - Keep explicit registration for single-router modules - Cleaner separation between simple and complex route modules
This commit is contained in:
parent
db7a0dbe28
commit
53aa54d6c9
3 changed files with 15 additions and 6 deletions
|
|
@ -377,3 +377,7 @@ async def admin_cancel_appointment(
|
|||
await db.refresh(appointment)
|
||||
|
||||
return _to_appointment_response(appointment) # Uses eager-loaded relationship
|
||||
|
||||
|
||||
# All routers from this module for easy registration
|
||||
routers = [router, appointments_router, admin_appointments_router]
|
||||
|
|
|
|||
|
|
@ -231,3 +231,7 @@ async def revoke_invite(
|
|||
await db.refresh(invite)
|
||||
|
||||
return build_invite_response(invite)
|
||||
|
||||
|
||||
# All routers from this module for easy registration
|
||||
routers = [router, admin_router]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue