From 62445b0b09b612951a17a915af2450084b93b881 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Tue, 23 May 2023 11:27:34 +0800 Subject: [PATCH 1/2] #4201 fix bug --- services/tech/tech.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/tech/tech.go b/services/tech/tech.go index 9217ac918e..5300d2706a 100644 --- a/services/tech/tech.go +++ b/services/tech/tech.go @@ -120,6 +120,10 @@ 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}, -- 2.34.1 From 20a41b407320f71780d6ed003320776b32cdbcf9 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Tue, 23 May 2023 11:29:50 +0800 Subject: [PATCH 2/2] #4201 fix bug --- services/tech/tech.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/tech/tech.go b/services/tech/tech.go index 5300d2706a..3bed459191 100644 --- a/services/tech/tech.go +++ b/services/tech/tech.go @@ -129,7 +129,7 @@ func SearchRepoInfoWithInstitution(opt *models.SearchRepoOpt) ([]*models.RepoWit ListOptions: models.ListOptions{Page: opt.Page, PageSize: opt.PageSize}, Sort: opt.OrderBy, Keyword: opt.Q, - Topics: []string{opt.Topic}, + Topics: topics, RepoIds: repoIds, }) -- 2.34.1