This commit is contained in:
2025-09-30 11:22:20 +03:00
parent 7d2e290fb6
commit e7a9b0a2f7
3 changed files with 7 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ async def protected(current_user: str = Depends(JWT.current_user)):
@api.get("/", response_model=list[pydentic.UserOut]) #список!
async def get_all_rows(current_user: str = Depends(JWT.current_user)):
users = await db.get_all_rows()
if not user:
if not users:
raise HTTPException(status_code=401, detail="The user isn't found")
return users
@api.get("/get_user_by_email/{email}", response_model=pydentic.UserOut)