docs: update documentation for platform-aware storefront routing
Update 8 documentation files to reflect new URL scheme:
- Dev: /platforms/{code}/storefront/{store_code}/
- Prod: subdomain.platform.lu/ (root path = storefront)
- Rename DEFAULT_PLATFORM_CODE to MAIN_PLATFORM_CODE
- Replace hardcoded platform_id=1 with dynamic values
- Update route examples, middleware descriptions, code samples
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -361,12 +361,12 @@ Platform context flows through middleware and JWT tokens:
|
||||
┌─────────────────────────────────────────────────────────────────────┐
|
||||
│ Route Handler (Dashboard) │
|
||||
│ │
|
||||
│ # Get platform_id from middleware or JWT token │
|
||||
│ platform = getattr(request.state, "platform", None) │
|
||||
│ platform_id = platform.id if platform else 1 │
|
||||
│ # Get platform from require_platform dependency │
|
||||
│ platform = Depends(require_platform) # Raises 400 if missing │
|
||||
│ platform_id = platform.id │
|
||||
│ │
|
||||
│ # Or from JWT for API routes │
|
||||
│ platform_id = current_user.token_platform_id or 1 │
|
||||
│ platform_id = current_user.token_platform_id │
|
||||
└─────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
@@ -392,13 +392,11 @@ Platform context flows through middleware and JWT tokens:
|
||||
def get_store_dashboard_stats(
|
||||
request: Request,
|
||||
current_user: UserContext = Depends(get_current_store_api),
|
||||
platform=Depends(require_platform),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
store_id = current_user.token_store_id
|
||||
|
||||
# Get platform from middleware
|
||||
platform = getattr(request.state, "platform", None)
|
||||
platform_id = platform.id if platform else 1
|
||||
platform_id = platform.id
|
||||
|
||||
# Get aggregated metrics from all enabled modules
|
||||
metrics = stats_aggregator.get_store_dashboard_stats(
|
||||
|
||||
Reference in New Issue
Block a user