Refactor topic Find functions and add more tests for pagination (#30127) (#30167)

Backport #30127 by @lunny

This also fixed #22238

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Giteabot
2024-03-30 01:09:40 +08:00
committed by GitHub
parent 40cdc84b36
commit af81b73d83
7 changed files with 70 additions and 32 deletions

View File

@@ -23,7 +23,7 @@ func TopicSearch(ctx *context.Context) {
},
}
topics, total, err := repo_model.FindTopics(ctx, opts)
topics, total, err := db.FindAndCount[repo_model.Topic](ctx, opts)
if err != nil {
ctx.Error(http.StatusInternalServerError)
return