first commit
This commit is contained in:
commit
bc94c75b54
31 files changed
+3483
No files matched your search
@@ -0,0 +1,14 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
from ..database import get_db
|
||||
from .. import crud, schemas
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/", response_model=schemas.ViolationOut)
|
||||
def create_violation(violation: schemas.ViolationCreate, db: Session = Depends(get_db)):
|
||||
return crud.create_violation(db, violation)
|
||||
|
||||
@router.get("/", response_model=list[schemas.ViolationOut])
|
||||
def list_violations(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
|
||||
return crud.get_violations(db, skip=skip, limit=limit)
|
||||
Reference in new issue
Block a user