mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-04 00:06:22 +00:00
fix: 纠正获取评论列表排序参数的错误
This commit is contained in:
@ -93,7 +93,7 @@ func (cc *CommentController) GetCommentList(ctx context.Context, c *app.RequestC
|
|||||||
if pagination.OrderBy == "" {
|
if pagination.OrderBy == "" {
|
||||||
pagination.OrderBy = constant.OrderByUpdatedAt
|
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, "无效的排序字段")
|
resps.BadRequest(c, "无效的排序字段")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user