fix: ruff lint + format fixes in tests, ESLint fixes in frontend
This commit is contained in:
@@ -30,7 +30,9 @@ async def list_vehicles(
|
||||
availability: str | None = Query(None, description="Filter by availability"),
|
||||
min_price: float | None = Query(None, ge=0, description="Minimum price"),
|
||||
max_price: float | None = Query(None, ge=0, description="Maximum price"),
|
||||
search: str | None = Query(None, description="Search in make, model, fin, location"),
|
||||
search: str | None = Query(
|
||||
None, description="Search in make, model, fin, location"
|
||||
),
|
||||
sort: str | None = Query(None, description="Sort field (prefix - for descending)"),
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
@@ -72,7 +74,9 @@ async def create_vehicle(
|
||||
return VehicleResponse.model_validate(vehicle)
|
||||
|
||||
|
||||
@router.get("/{vehicle_id}", response_model=VehicleResponse, status_code=status.HTTP_200_OK)
|
||||
@router.get(
|
||||
"/{vehicle_id}", response_model=VehicleResponse, status_code=status.HTTP_200_OK
|
||||
)
|
||||
async def get_vehicle(
|
||||
vehicle_id: uuid.UUID,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
@@ -83,12 +87,16 @@ async def get_vehicle(
|
||||
if vehicle is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail={"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}},
|
||||
detail={
|
||||
"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}
|
||||
},
|
||||
)
|
||||
return VehicleResponse.model_validate(vehicle)
|
||||
|
||||
|
||||
@router.put("/{vehicle_id}", response_model=VehicleResponse, status_code=status.HTTP_200_OK)
|
||||
@router.put(
|
||||
"/{vehicle_id}", response_model=VehicleResponse, status_code=status.HTTP_200_OK
|
||||
)
|
||||
async def update_vehicle(
|
||||
vehicle_id: uuid.UUID,
|
||||
body: VehicleUpdate,
|
||||
@@ -112,12 +120,16 @@ async def update_vehicle(
|
||||
if vehicle is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail={"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}},
|
||||
detail={
|
||||
"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}
|
||||
},
|
||||
)
|
||||
return VehicleResponse.model_validate(vehicle)
|
||||
|
||||
|
||||
@router.delete("/{vehicle_id}", response_model=VehicleResponse, status_code=status.HTTP_200_OK)
|
||||
@router.delete(
|
||||
"/{vehicle_id}", response_model=VehicleResponse, status_code=status.HTTP_200_OK
|
||||
)
|
||||
async def delete_vehicle(
|
||||
vehicle_id: uuid.UUID,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
@@ -128,7 +140,9 @@ async def delete_vehicle(
|
||||
if vehicle is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail={"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}},
|
||||
detail={
|
||||
"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}
|
||||
},
|
||||
)
|
||||
return VehicleResponse.model_validate(vehicle)
|
||||
|
||||
@@ -148,7 +162,9 @@ async def push_to_mobile_de(
|
||||
if vehicle is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail={"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}},
|
||||
detail={
|
||||
"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}
|
||||
},
|
||||
)
|
||||
|
||||
listing = await mobilede_service.push_listing(db, vehicle)
|
||||
@@ -176,7 +192,9 @@ async def get_mobile_de_status(
|
||||
if vehicle is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail={"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}},
|
||||
detail={
|
||||
"error": {"code": "VEHICLE_NOT_FOUND", "message": "Vehicle not found"}
|
||||
},
|
||||
)
|
||||
|
||||
listing = await mobilede_service.get_listing_status(db, vehicle_id)
|
||||
|
||||
Reference in New Issue
Block a user