Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: resolve 404 error on Tags static page

sy-records68570d727119
diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go
index 4692e855..df10931e 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -449,13 +449,13 @@ func (tc *TemplateController) QuestionInfo(ctx *gin.Context) {
// TagList tags list
func (tc *TemplateController) TagList(ctx *gin.Context) {
- req := &schema.GetTagWithPageReq{}
+ req := &schema.GetTagWithPageReq{
+ PageSize: constant.DefaultPageSize,
+ Page: 1,
+ }
if handler.BindAndCheck(ctx, req) {
return
}
- if req.PageSize == 0 {
- req.PageSize = constant.DefaultPageSize
- }
data, err := tc.templateRenderController.TagList(ctx, req)
if err != nil || pager.ValPageOutOfRange(data.Count, req.Page, req.PageSize) {
tc.Page404(ctx)