sql_app/schema: fix type error
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
64edc98a76
commit
98c3f5416a
@ -4,6 +4,9 @@ from sqlalchemy.orm import Session
|
|||||||
from . import crud, models, schemas
|
from . import crud, models, schemas
|
||||||
from .database import SessionLocal, engine
|
from .database import SessionLocal, engine
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
models.Base.metadata.create_all(bind=engine)
|
models.Base.metadata.create_all(bind=engine)
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
@ -26,7 +29,7 @@ def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
|
|||||||
return crud.create_user(db=db, user=user)
|
return crud.create_user(db=db, user=user)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/users/", response_model=list[schemas.User])
|
@app.get("/users/", response_model=List[schemas.User])
|
||||||
def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
|
def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
|
||||||
users = crud.get_users(db, skip=skip, limit=limit)
|
users = crud.get_users(db, skip=skip, limit=limit)
|
||||||
return users
|
return users
|
||||||
|
Loading…
Reference in New Issue
Block a user