forked from forgejo/forgejo
Hide internal package versions (#20492)
* Hide internal versions from most searches. * Added test.
This commit is contained in:
parent
5ed082b624
commit
a3d55ac523
12 changed files with 66 additions and 31 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -32,10 +33,11 @@ func Packages(ctx *context.Context) {
|
|||
PageSize: setting.UI.PackagesPagingNum,
|
||||
Page: page,
|
||||
},
|
||||
OwnerID: ctx.ContextUser.ID,
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Type: packages.Type(packageType),
|
||||
Name: packages.SearchValue{Value: query},
|
||||
OwnerID: ctx.ContextUser.ID,
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Type: packages.Type(packageType),
|
||||
Name: packages.SearchValue{Value: query},
|
||||
IsInternal: util.OptionalBoolFalse,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("SearchLatestVersions", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue