switching from optional response_model to mandatory return type

This commit is contained in:
msramalho
2024-10-29 16:17:40 +00:00
parent aaada7d83f
commit 8c658cdf52
7 changed files with 35 additions and 30 deletions

View File

@@ -30,13 +30,13 @@ async def health():
return JSONResponse({"status": "ok"})
@default_router.get("/user/active", summary="Check if the user is active and can use the tool.", response_model=schemas.ActiveUser)
async def active(db: Session = Depends(get_db_dependency), email=Depends(get_user_auth)):
@default_router.get("/user/active", summary="Check if the user is active and can use the tool.")
async def active(db: Session = Depends(get_db_dependency), email=Depends(get_user_auth)) -> schemas.ActiveUser:
return {"active": crud.is_active_user(db, email)}
@default_router.get("/groups", response_model=list[str])
def get_user_groups(db: Session = Depends(get_db_dependency), email=Depends(get_user_auth)):
@default_router.get("/groups")
def get_user_groups(db: Session = Depends(get_db_dependency), email=Depends(get_user_auth)) -> list[str]:
return crud.get_user_groups(db, email)