diff --git a/services/tech/tech.go b/services/tech/tech.go index 9217ac918e..3bed459191 100644 --- a/services/tech/tech.go +++ b/services/tech/tech.go @@ -120,12 +120,16 @@ func SearchRepoInfoWithInstitution(opt *models.SearchRepoOpt) ([]*models.RepoWit return []*models.RepoWithInstitution{}, 0, nil } repoIds, institutionMap := getRepoIdAndInstitutionMap(infos) + topics := make([]string, 0) + if opt.Topic != "" { + topics = append(topics, opt.Topic) + } result, err := repository.FindRepos(repository.FindReposOptions{ ListOptions: models.ListOptions{Page: opt.Page, PageSize: opt.PageSize}, Sort: opt.OrderBy, Keyword: opt.Q, - Topics: []string{opt.Topic}, + Topics: topics, RepoIds: repoIds, })