Skip to content

Commit 769e8ad

Browse files
committed
fix: rename Topic to TopicOnly
1 parent 612815d commit 769e8ad

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

models/repo_list.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ type SearchRepoOptions struct {
132132
// False -> include just non-mirrors
133133
Mirror util.OptionalBool
134134
// only search topic name
135-
Topic bool
135+
TopicOnly bool
136136
}
137137

138138
//SearchOrderBy is used to sort the result
@@ -205,7 +205,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, err
205205

206206
if opts.Keyword != "" {
207207
var keywordCond = builder.NewCond()
208-
if opts.Topic {
208+
if opts.TopicOnly {
209209
keywordCond = keywordCond.Or(builder.Like{"topic.name", strings.ToLower(opts.Keyword)})
210210
} else {
211211
keywordCond = keywordCond.Or(builder.Like{"lower_name", strings.ToLower(opts.Keyword)})

routers/api/v1/repo/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func Search(ctx *context.APIContext) {
9191
OwnerID: ctx.QueryInt64("uid"),
9292
Page: ctx.QueryInt("page"),
9393
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
94-
Topic: ctx.QueryBool("topic"),
94+
TopicOnly: ctx.QueryBool("topic"),
9595
Collaborate: util.OptionalBoolNone,
9696
}
9797

routers/home.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
122122
}
123123

124124
keyword := strings.Trim(ctx.Query("q"), " ")
125-
topic := ctx.QueryBool("topic")
125+
topicOnly := ctx.QueryBool("topic")
126126

127127
repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
128128
Page: page,
@@ -132,7 +132,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
132132
Keyword: keyword,
133133
OwnerID: opts.OwnerID,
134134
AllPublic: true,
135-
Topic: topic,
135+
TopicOnly: topicOnly,
136136
})
137137
if err != nil {
138138
ctx.ServerError("SearchRepositoryByName", err)

routers/user/profile.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func Profile(ctx *context.Context) {
105105
page = 1
106106
}
107107

108-
topic := ctx.QueryBool("topic")
108+
topicOnly := ctx.QueryBool("topic")
109109

110110
var (
111111
repos []*models.Repository
@@ -176,7 +176,7 @@ func Profile(ctx *context.Context) {
176176
PageSize: setting.UI.User.RepoPagingNum,
177177
Starred: true,
178178
Collaborate: util.OptionalBoolFalse,
179-
Topic: topic,
179+
TopicOnly: topicOnly,
180180
})
181181
if err != nil {
182182
ctx.ServerError("SearchRepositoryByName", err)
@@ -220,7 +220,7 @@ func Profile(ctx *context.Context) {
220220
IsProfile: true,
221221
PageSize: setting.UI.User.RepoPagingNum,
222222
Collaborate: util.OptionalBoolFalse,
223-
Topic: topic,
223+
TopicOnly: topicOnly,
224224
})
225225
if err != nil {
226226
ctx.ServerError("SearchRepositoryByName", err)

0 commit comments

Comments
 (0)