diff --git a/app/routers/web.py b/app/routers/web.py index d9dae80..8c571c4 100644 --- a/app/routers/web.py +++ b/app/routers/web.py @@ -452,12 +452,12 @@ def profile_rename(profile_id: int, nickname: str = Form(...), user: User = Depe @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)): +def profile_notes(profile_id: int, notes: str = Form(""), redirect_to: str = Form("/profiles"), 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") + return _redirect(redirect_to) # ---------- Postcards ---------- diff --git a/app/templates/postcards.html b/app/templates/postcards.html index 63b6b15..af287f5 100644 --- a/app/templates/postcards.html +++ b/app/templates/postcards.html @@ -5,6 +5,13 @@

{{ profile.nickname }} 的明信片

+ 新明信片 +
+
+ + + +
+
-
- -
+
+ + +