From b618bdf0da87ed20f0a334d609ad13c94594ef63 Mon Sep 17 00:00:00 2001 From: dv Date: Wed, 8 Apr 2026 23:27:25 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D1=83=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/global_devices.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/app/routers/global_devices.py b/backend/app/routers/global_devices.py index f2fc6f0..183a7cb 100644 --- a/backend/app/routers/global_devices.py +++ b/backend/app/routers/global_devices.py @@ -1,9 +1,12 @@ """Global devices endpoint — cross-object device listing with filters.""" +import logging from typing import Optional -from fastapi import APIRouter, Depends +from fastapi import APIRouter, Depends, Query from sqlalchemy import select + +logger = logging.getLogger(__name__) from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload @@ -18,7 +21,7 @@ router = APIRouter(prefix="/api/v1/devices", tags=["devices-global"]) @router.get("", response_model=list[DeviceRead]) async def list_all_devices( - category: Optional[list[str]] = None, + category: Optional[list[str]] = Query(default=None), city: Optional[str] = None, client: Optional[str] = None, object_id: Optional[int] = None, @@ -34,6 +37,8 @@ async def list_all_devices( - All bank terminals for a client: ?category=bank_terminal&client=Авангард - All devices in a city: ?city=Санкт-Петербург """ + logger.info("list_all_devices called: category=%r city=%r client=%r object_id=%r status=%r", category, city, client, object_id, status) + query = ( select(Device) .join(Object, Device.object_id == Object.id)