fix(CommentsView): 移除固定高度并添加滚动条以改善用户体验
refactor(listComments): 简化评论排序逻辑 移除CommentsView中的固定高度限制并添加overflow-y属性,使内容可滚动 修改listComments的SQL查询,去除priority排序以简化逻辑
This commit is contained in:
@@ -27,7 +27,7 @@ export const listComments = async (c: Context<{ Bindings: Bindings }>) => {
|
||||
.first<{ count: number }>();
|
||||
|
||||
const { results } = await c.env.CWD_DB.prepare(
|
||||
`SELECT * FROM Comment ${whereSql} ORDER BY priority DESC, created DESC LIMIT ? OFFSET ?`
|
||||
`SELECT * FROM Comment ${whereSql} ORDER BY created DESC LIMIT ? OFFSET ?`
|
||||
)
|
||||
.bind(...params, limit, offset)
|
||||
.all();
|
||||
|
||||
Reference in New Issue
Block a user