main: reorder

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2022-04-13 07:07:00 +03:00
parent 40d981a4cd
commit a28183ddd8
Signed by: Hesham
GPG Key ID: 74876157D199B09E

View File

@ -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