feat(profile): 프로필에 '한줄 소개' 추가 — 본인만 인라인 편집
- users.bio 컬럼(멱등) + db.setBio / getUserProfile 조회 포함 - POST /profile/bio (본인만, fetch JSON / 폼 POST 폴백) - 프로필 히어로: 이름·사번 한 줄로 합치고 한줄 소개를 3줄째로 배치 - 본인은 연필 버튼으로 인라인 편집(저장/취소·Esc), 최대 80자 - word-break: keep-all 로 한글 단어 중간 잘림 방지 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,16 @@ app.post(
|
||||
}
|
||||
);
|
||||
|
||||
// --- 한줄 소개 저장(본인) ---
|
||||
// JS 있으면 fetch(JSON), 없으면 폼 POST → 프로필로 리다이렉트(점진적 향상).
|
||||
app.post("/profile/bio", requireAuth, async (req, res) => {
|
||||
const sabun = req.session.user.sabun;
|
||||
const bio = String(req.body.bio || "").trim().slice(0, 80);
|
||||
await db.setBio({ sabun, bio });
|
||||
if (isAjax(req)) return res.json({ ok: true, bio });
|
||||
res.redirect("/u/" + encodeURIComponent(sabun));
|
||||
});
|
||||
|
||||
// --- 프로필 페이지 (본인/타인) — 프로필 + 해당 사용자의 프로젝트 목록 ---
|
||||
app.get("/u/:sabun", requireAuth, async (req, res) => {
|
||||
const me = req.session.user.sabun;
|
||||
|
||||
Reference in New Issue
Block a user