Update main.py
Browse files
main.py
CHANGED
@@ -18,7 +18,7 @@ def get_db():
|
|
18 |
|
19 |
user_router = APIRouter(prefix="/user")
|
20 |
|
21 |
-
@user_router.post("/users/", response_model=schemas.User)
|
22 |
def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
|
23 |
db_user = crud.get_user_by_email(db, email=user.email)
|
24 |
if db_user:
|
@@ -26,7 +26,7 @@ def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
|
|
26 |
return crud.create_user(db=db, user=user)
|
27 |
|
28 |
|
29 |
-
@user_router.get("/users/", response_model=list[schemas.User])
|
30 |
def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
|
31 |
users = crud.get_users(db, skip=skip, limit=limit)
|
32 |
return users
|
|
|
18 |
|
19 |
user_router = APIRouter(prefix="/user")
|
20 |
|
21 |
+
@user_router.post("/users/", response_model=schemas.User, tags=["users")
|
22 |
def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
|
23 |
db_user = crud.get_user_by_email(db, email=user.email)
|
24 |
if db_user:
|
|
|
26 |
return crud.create_user(db=db, user=user)
|
27 |
|
28 |
|
29 |
+
@user_router.get("/users/", response_model=list[schemas.User], tags=["users"])
|
30 |
def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
|
31 |
users = crud.get_users(db, skip=skip, limit=limit)
|
32 |
return users
|