From a28183ddd854e00745301dd953f224e3f68f63ab Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Wed, 13 Apr 2022 07:07:00 +0300 Subject: [PATCH] main: reorder Signed-off-by: HeshamTB --- sql_app/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sql_app/main.py b/sql_app/main.py index 957864b..a73476c 100644 --- a/sql_app/main.py +++ b/sql_app/main.py @@ -60,6 +60,9 @@ def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)): return crud.create_user(db=db, user=user) +@app.get("/users/me/", response_model=schemas.User, tags=['Users']) +async def get_user_details(current_user: schemas.User = Depends(get_current_active_user)): + return current_user @app.get("/admin/users/", response_model=List[schemas.User], tags=['Admin']) def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)): @@ -100,9 +103,5 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends( ) return {"access_token": access_token, "token_type": "bearer"} -@app.get("/users/me/", response_model=schemas.User, tags=['Users']) -async def get_user_details(current_user: schemas.User = Depends(get_current_active_user)): - return current_user -