486749a890
Full-stack Dutch supermarket price tracker with FastAPI backend, PostgreSQL/SQLAlchemy, Albert Heijn scraper, and Next.js frontend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
428 B
Python
15 lines
428 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy import select
|
|
from sqlalchemy.orm import Session
|
|
|
|
from ..database import get_db
|
|
from ..models import Store
|
|
from ..schemas import Store as StoreSchema
|
|
|
|
router = APIRouter(prefix="/api/stores", tags=["stores"])
|
|
|
|
|
|
@router.get("", response_model=list[StoreSchema])
|
|
def list_stores(db: Session = Depends(get_db)):
|
|
return db.scalars(select(Store).order_by(Store.name)).all()
|