feat: align with upstream — pin posts, edit marker, custom CSS, UX fixes
- Pin/unpin posts (PUT /api/posts/:id/pin, admin) with notification to author
- is_pinned/pinned_at in schema; 📌 badge on feed + detail; admin pin button
- Edited marker (已编辑) on feed + detail; edit button + modal for authors
- Custom CSS: upload/delete API + admin tab + global loader (style.css override)
- Fix: duplicate post title on detail page (remove card title, keep header)
- Fix: forum name flicker on load (localStorage cache before fetch)
- Fix: dropdown menu closes on outside click (document listener)
- Fix: document.title + <title> sync on forum rename
This commit is contained in:
1 parent
721e4bfe42
commit
48372aa14f
14 files changed
+371
-10
No files matched your search
@@ -0,0 +1,14 @@
|
||||
// 通知工具(供各 Route Handler 调用)
|
||||
import pool from './db';
|
||||
|
||||
// 创建通知(内部函数,静默失败不影响主流程)
|
||||
export async function createNotification(userId, type, title, content, link = null) {
|
||||
try {
|
||||
await pool.query(
|
||||
'INSERT INTO notifications (user_id, type, title, content, link) VALUES ($1, $2, $3, $4, $5)',
|
||||
[userId, type, title, content, link]
|
||||
);
|
||||
} catch {
|
||||
// 静默失败
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user