From 6319a9dc2913f005c735835ac4b46301d6885c64 Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 3 Nov 2025 08:29:33 -0300 Subject: outros routes --- api/routes/locations.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'api/routes/locations.py') diff --git a/api/routes/locations.py b/api/routes/locations.py index c3b30aa..5050cef 100644 --- a/api/routes/locations.py +++ b/api/routes/locations.py @@ -12,10 +12,11 @@ router = APIRouter( async def get_locations(): dc = {'locations': []} session = SessionLocal() - stmt = select(Location.street, Location.avenue, Location.zip_code) - locs = session.execute(stmt).all() # TODO: Page results - for loc in locs: + stmt = select(Location) + locs = session.execute(stmt) # TODO: Page results + for loc in locs.scalars(): l = { + 'id': loc.id, 'street': loc.street, 'avenue': loc.avenue, 'zip_code': loc.zip_code -- cgit v1.2.3