diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-07-29 09:42:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-29 03:42:15 +0200 |
commit | 33e0b38287fdc3487112062300b8dd3c95415ee7 (patch) | |
tree | 603394d8f303de1031c21da0d3d3a3cdc0b2bfda /routers/api/v1/repo/repo.go | |
parent | 370516883717de0e6e2087c12d368eb1465ee3b0 (diff) | |
download | gitea-33e0b38287fdc3487112062300b8dd3c95415ee7.tar.gz gitea-33e0b38287fdc3487112062300b8dd3c95415ee7.zip |
Rename context.Query to context.Form (#16562)
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r-- | routers/api/v1/repo/repo.go | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 5e0228fdbe..9c93408832 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -135,27 +135,27 @@ func Search(ctx *context.APIContext) { opts := &models.SearchRepoOptions{ ListOptions: utils.GetListOptions(ctx), Actor: ctx.User, - Keyword: strings.Trim(ctx.Query("q"), " "), - OwnerID: ctx.QueryInt64("uid"), - PriorityOwnerID: ctx.QueryInt64("priority_owner_id"), - TeamID: ctx.QueryInt64("team_id"), - TopicOnly: ctx.QueryBool("topic"), + Keyword: strings.Trim(ctx.Form("q"), " "), + OwnerID: ctx.FormInt64("uid"), + PriorityOwnerID: ctx.FormInt64("priority_owner_id"), + TeamID: ctx.FormInt64("team_id"), + TopicOnly: ctx.FormBool("topic"), Collaborate: util.OptionalBoolNone, - Private: ctx.IsSigned && (ctx.Query("private") == "" || ctx.QueryBool("private")), + Private: ctx.IsSigned && (ctx.Form("private") == "" || ctx.FormBool("private")), Template: util.OptionalBoolNone, - StarredByID: ctx.QueryInt64("starredBy"), - IncludeDescription: ctx.QueryBool("includeDesc"), + StarredByID: ctx.FormInt64("starredBy"), + IncludeDescription: ctx.FormBool("includeDesc"), } - if ctx.Query("template") != "" { - opts.Template = util.OptionalBoolOf(ctx.QueryBool("template")) + if ctx.Form("template") != "" { + opts.Template = util.OptionalBoolOf(ctx.FormBool("template")) } - if ctx.QueryBool("exclusive") { + if ctx.FormBool("exclusive") { opts.Collaborate = util.OptionalBoolFalse } - var mode = ctx.Query("mode") + var mode = ctx.Form("mode") switch mode { case "source": opts.Fork = util.OptionalBoolFalse @@ -173,17 +173,17 @@ func Search(ctx *context.APIContext) { return } - if ctx.Query("archived") != "" { - opts.Archived = util.OptionalBoolOf(ctx.QueryBool("archived")) + if ctx.Form("archived") != "" { + opts.Archived = util.OptionalBoolOf(ctx.FormBool("archived")) } - if ctx.Query("is_private") != "" { - opts.IsPrivate = util.OptionalBoolOf(ctx.QueryBool("is_private")) + if ctx.Form("is_private") != "" { + opts.IsPrivate = util.OptionalBoolOf(ctx.FormBool("is_private")) } - var sortMode = ctx.Query("sort") + var sortMode = ctx.Form("sort") if len(sortMode) > 0 { - var sortOrder = ctx.Query("order") + var sortOrder = ctx.Form("order") if len(sortOrder) == 0 { sortOrder = "asc" } |