e329d3398a
Add FastAPI/React app with Docker deployment, Ubuntu one-click install, and docs for junior/senior high score tracking and mistake bank. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
524 B
Python
18 lines
524 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.core.database import get_db
|
|
from app.core.deps import get_current_user
|
|
from app.models.user import Subject, User
|
|
from app.schemas import SubjectOut
|
|
|
|
router = APIRouter(prefix="/subjects", tags=["subjects"])
|
|
|
|
|
|
@router.get("", response_model=list[SubjectOut])
|
|
def list_subjects(
|
|
db: Session = Depends(get_db),
|
|
current_user: User = Depends(get_current_user),
|
|
):
|
|
return db.query(Subject).order_by(Subject.id).all()
|