Skip to content

Commit

Permalink
fix: update user example to avoid undefined variable
Browse files Browse the repository at this point in the history
Co-Authored-By: Alek Petuskey <alek@reflex.dev>
  • Loading branch information
devin-ai-integration[bot] and Alek Petuskey committed Dec 11, 2024
1 parent 814ac8e commit aa95835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api-routes/examples/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ async def create_user(user_data: UserModel, token: str):
async def get_user(user_id: str, token: str):
"""Get user data."""
state = await app.state_manager.get_state(token)
if state.user and state.user.id == user_id:
return state.user
if state.user and state.user.name == "John Doe": # Example comparison
return {"status": "success", "user": state.user.dict()}
raise HTTPException(status_code=404, detail="User not found")
```

Expand Down

0 comments on commit aa95835

Please sign in to comment.