fix: Route dashboard API requests to orchestrator service instead of inventory

The gateway was incorrectly routing /tenants/{id}/dashboard/* requests
to the inventory service, but the dashboard endpoints are actually
implemented in the orchestrator service.

Changed:
- gateway/app/routes/tenant.py:300 from _proxy_to_inventory_service
  to _proxy_to_orchestrator_service

This fixes 404 errors when loading the dashboard in demo mode.
This commit is contained in:
Claude
2025-11-07 21:49:31 +00:00
parent 449c231af0
commit eabd5eedc7

View File

@@ -294,10 +294,10 @@ async def proxy_tenant_stock(request: Request, tenant_id: str = Path(...), path:
@router.api_route("/{tenant_id}/dashboard/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"]) @router.api_route("/{tenant_id}/dashboard/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
async def proxy_tenant_dashboard(request: Request, tenant_id: str = Path(...), path: str = ""): async def proxy_tenant_dashboard(request: Request, tenant_id: str = Path(...), path: str = ""):
"""Proxy tenant dashboard requests to inventory service""" """Proxy tenant dashboard requests to orchestrator service"""
# The inventory service dashboard endpoints are tenant-scoped: /api/v1/tenants/{tenant_id}/dashboard/{path} # The orchestrator service dashboard endpoints are tenant-scoped: /api/v1/tenants/{tenant_id}/dashboard/{path}
target_path = f"/api/v1/tenants/{tenant_id}/dashboard/{path}".rstrip("/") target_path = f"/api/v1/tenants/{tenant_id}/dashboard/{path}".rstrip("/")
return await _proxy_to_inventory_service(request, target_path, tenant_id=tenant_id) return await _proxy_to_orchestrator_service(request, target_path, tenant_id=tenant_id)
@router.api_route("/{tenant_id}/transformations", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"]) @router.api_route("/{tenant_id}/transformations", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
async def proxy_tenant_transformations_base(request: Request, tenant_id: str = Path(...)): async def proxy_tenant_transformations_base(request: Request, tenant_id: str = Path(...)):