fix: move health-overview and health-scores routes before /{customer_id} to prevent UUID matching error

This commit is contained in:
TradeMate Dev
2026-05-14 10:34:03 +08:00
parent 4460131b71
commit aacb53f111
+18 -18
View File
@@ -39,6 +39,24 @@ async def get_silent(
} }
@router.get("/health-overview")
async def get_health_overview(
user_id: str = Depends(get_current_user_id),
db: AsyncSession = Depends(get_db),
):
service = CustomerHealthService(db)
return await service.get_health_overview(user_id)
@router.get("/health-scores")
async def get_all_health_scores(
user_id: str = Depends(get_current_user_id),
db: AsyncSession = Depends(get_db),
):
service = CustomerHealthService(db)
return {"items": await service.get_all_health_scores(user_id)}
@router.get("/{customer_id}") @router.get("/{customer_id}")
async def get_customer( async def get_customer(
customer_id: str, customer_id: str,
@@ -148,24 +166,6 @@ async def export_customers(
) )
@router.get("/health-overview")
async def get_health_overview(
user_id: str = Depends(get_current_user_id),
db: AsyncSession = Depends(get_db),
):
service = CustomerHealthService(db)
return await service.get_health_overview(user_id)
@router.get("/health-scores")
async def get_all_health_scores(
user_id: str = Depends(get_current_user_id),
db: AsyncSession = Depends(get_db),
):
service = CustomerHealthService(db)
return {"items": await service.get_all_health_scores(user_id)}
@router.get("/{customer_id}/health") @router.get("/{customer_id}/health")
async def get_customer_health( async def get_customer_health(
customer_id: str, customer_id: str,