summaryrefslogtreecommitdiff
path: root/api/routes/locations.py
diff options
context:
space:
mode:
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