fix: 纠正获取评论列表排序参数的错误

This commit is contained in:
2025-07-26 16:31:15 +08:00
parent 339d420918
commit 2bd981135d

View File

@ -93,7 +93,7 @@ func (cc *CommentController) GetCommentList(ctx context.Context, c *app.RequestC
if pagination.OrderBy == "" {
pagination.OrderBy = constant.OrderByUpdatedAt
}
if pagination.OrderBy != "" && !slices.Contains(constant.OrderByEnumPost, pagination.OrderBy) {
if pagination.OrderBy != "" && !slices.Contains(constant.OrderByEnumComment, pagination.OrderBy) {
resps.BadRequest(c, "无效的排序字段")
return
}