Compare commits

..

1 Commits

Author SHA1 Message Date
Tim
a5ec0348a9 chore: alter notifications type column 2025-08-14 15:15:58 +08:00
3 changed files with 5 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE notifications
MODIFY COLUMN type VARCHAR(50) NOT NULL;

View File

@@ -265,7 +265,7 @@ const {
time: TimeManager.format(
selectedTopic.value === '最新回复' ? p.lastReplyAt || p.createdAt : p.createdAt,
),
pinned: Boolean(p.pinned ?? p.pinnedAt ?? p.pinned_at),
pinned: !!p.pinnedAt,
type: p.type,
}))
},
@@ -308,7 +308,7 @@ const fetchNextPage = async () => {
time: TimeManager.format(
selectedTopic.value === '最新回复' ? p.lastReplyAt || p.createdAt : p.createdAt,
),
pinned: Boolean(p.pinned ?? p.pinnedAt ?? p.pinned_at),
pinned: !!p.pinnedAt,
type: p.type,
}))
articles.value.push(...mapped)

View File

@@ -392,7 +392,7 @@ const mapComment = (c, parentUserName = '', level = 0) => ({
avatar: c.author.avatar,
text: c.content,
reactions: c.reactions || [],
pinned: Boolean(c.pinned ?? c.pinnedAt ?? c.pinned_at),
pinned: !!c.pinnedAt,
reply: (c.replies || []).map((r) => mapComment(r, c.author.username, level + 1)),
openReplies: level === 0,
src: c.author.avatar,