mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-16 19:49:56 +00:00
Refactor topic Find functions and add more tests for pagination (#30127)
This also fixed #22238
This commit is contained in:
@@ -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
|
||||
|
@@ -899,7 +899,7 @@ func renderLanguageStats(ctx *context.Context) {
|
||||
}
|
||||
|
||||
func renderRepoTopics(ctx *context.Context) {
|
||||
topics, _, err := repo_model.FindTopics(ctx, &repo_model.FindTopicOptions{
|
||||
topics, err := db.Find[repo_model.Topic](ctx, &repo_model.FindTopicOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
})
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user