frontend kínlódás
This commit is contained in:
@@ -20,15 +20,16 @@ async def list_makes(
|
||||
@router.get("/models", response_model=List[str])
|
||||
async def list_models(
|
||||
make: str,
|
||||
vehicle_class: str = None,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
current_user = Depends(deps.get_current_user)
|
||||
):
|
||||
"""2. Szint: Típusok listázása egy adott márkához."""
|
||||
"""2. Szint: Típusok listázása egy adott márkához, opcionálisan vehicle_class szerint szűrve."""
|
||||
# Handle empty or invalid parameters gracefully
|
||||
if not make or make.strip() == "":
|
||||
return []
|
||||
|
||||
models = await AssetService.get_models(db, make)
|
||||
models = await AssetService.get_models(db, make, vehicle_class)
|
||||
# Return empty list instead of 404 - frontend can handle empty dropdown
|
||||
return models or []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user