summaryrefslogtreecommitdiff
path: root/api/routes/locations.py
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-11-03 08:29:33 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-11-03 08:29:33 -0300
commit6319a9dc2913f005c735835ac4b46301d6885c64 (patch)
treedb25b78d0013e3cf3c0759575b76dc0bbcc92752 /api/routes/locations.py
parent9e5e5da02b4a9704543e0efd7eb568b31a77a369 (diff)
outros routes
Diffstat (limited to 'api/routes/locations.py')
-rw-r--r--api/routes/locations.py7
1 files changed, 4 insertions, 3 deletions
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