feat(profiles): add private notes field per profile, visible only to owner

This commit is contained in:
2026-07-06 19:36:29 +08:00
parent 233da50554
commit b6d43b3db4
3 changed files with 19 additions and 1 deletions

View File

@@ -451,6 +451,15 @@ def profile_rename(profile_id: int, nickname: str = Form(...), user: User = Depe
return _redirect("/profiles")
@router.post("/profiles/{profile_id}/notes")
def profile_notes(profile_id: int, notes: str = Form(""), user: User = Depends(get_current_user_web), db: Session = Depends(get_db)):
p = db.query(Profile).filter(Profile.id == profile_id, Profile.user_id == user.id).first()
if p:
p.notes = notes
db.commit()
return _redirect("/profiles")
# ---------- Postcards ----------
@router.get("/profiles/{profile_id}/postcards", response_class=HTMLResponse)