diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-07-27 03:59:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 09:59:10 +0800 |
commit | a3d55ac52337ecc843a0ff353cde9e5a46b7f463 (patch) | |
tree | 206f1c14eaf3ddb73a75731bb4b6f8c75bad706e /routers/api/v1/packages | |
parent | 5ed082b62491f17c6c91e21f8fe7d544559b0ea1 (diff) | |
download | gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.tar.gz gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.zip |
Hide internal package versions (#20492)
* Hide internal versions from most searches.
* Added test.
Diffstat (limited to 'routers/api/v1/packages')
-rw-r--r-- | routers/api/v1/packages/package.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/api/v1/packages/package.go b/routers/api/v1/packages/package.go index 038924737a..5a9c93b3ca 100644 --- a/routers/api/v1/packages/package.go +++ b/routers/api/v1/packages/package.go @@ -11,6 +11,7 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/api/v1/utils" packages_service "code.gitea.io/gitea/services/packages" ) @@ -55,10 +56,11 @@ func ListPackages(ctx *context.APIContext) { query := ctx.FormTrim("q") pvs, count, err := packages.SearchVersions(ctx, &packages.PackageSearchOptions{ - OwnerID: ctx.Package.Owner.ID, - Type: packages.Type(packageType), - Name: packages.SearchValue{Value: query}, - Paginator: &listOptions, + OwnerID: ctx.Package.Owner.ID, + Type: packages.Type(packageType), + Name: packages.SearchValue{Value: query}, + IsInternal: util.OptionalBoolFalse, + Paginator: &listOptions, }) if err != nil { ctx.Error(http.StatusInternalServerError, "SearchVersions", err) |