Add display_name support for users in backend and frontend

This commit introduces the `display_name` field to the user model. It updates database migrations, API endpoints, and the admin panel to handle this field. Additionally, the `display_name` is now shown in the TopBar and WinnerBadge components, improving user experience.
This commit is contained in:
2026-02-06 12:09:21 +01:00
parent 4a012b7345
commit 3a66c0cf74
7 changed files with 140 additions and 26 deletions

View File

@@ -40,7 +40,8 @@ def me(req: Request, db: Session = Depends(get_db)):
user = db.query(User).filter(User.id == uid).first()
if not user:
raise HTTPException(status_code=401, detail="not logged in")
return {"id": user.id, "email": user.email, "role": user.role, "theme_key": user.theme_key}
return {"id": user.id, "email": user.email, "role": user.role, "display_name": user.display_name}
@router.patch("/password")