aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages/rubygems
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-07-27 03:59:10 +0200
committerGitHub <noreply@github.com>2022-07-27 09:59:10 +0800
commita3d55ac52337ecc843a0ff353cde9e5a46b7f463 (patch)
tree206f1c14eaf3ddb73a75731bb4b6f8c75bad706e /routers/api/packages/rubygems
parent5ed082b62491f17c6c91e21f8fe7d544559b0ea1 (diff)
downloadgitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.tar.gz
gitea-a3d55ac52337ecc843a0ff353cde9e5a46b7f463.zip
Hide internal package versions (#20492)
* Hide internal versions from most searches. * Added test.
Diffstat (limited to 'routers/api/packages/rubygems')
-rw-r--r--routers/api/packages/rubygems/rubygems.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/api/packages/rubygems/rubygems.go b/routers/api/packages/rubygems/rubygems.go
index b3815a914e..4f066a8303 100644
--- a/routers/api/packages/rubygems/rubygems.go
+++ b/routers/api/packages/rubygems/rubygems.go
@@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/modules/context"
packages_module "code.gitea.io/gitea/modules/packages"
rubygems_module "code.gitea.io/gitea/modules/packages/rubygems"
+ "code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/routers/api/packages/helper"
packages_service "code.gitea.io/gitea/services/packages"
)
@@ -40,8 +41,9 @@ func EnumeratePackages(ctx *context.Context) {
// EnumeratePackagesLatest serves the list of the latest version of every package
func EnumeratePackagesLatest(ctx *context.Context) {
pvs, _, err := packages_model.SearchLatestVersions(ctx, &packages_model.PackageSearchOptions{
- OwnerID: ctx.Package.Owner.ID,
- Type: packages_model.TypeRubyGems,
+ OwnerID: ctx.Package.Owner.ID,
+ Type: packages_model.TypeRubyGems,
+ IsInternal: util.OptionalBoolFalse,
})
if err != nil {
apiError(ctx, http.StatusInternalServerError, err)
@@ -289,6 +291,7 @@ func getVersionsByFilename(ctx *context.Context, filename string) ([]*packages_m
OwnerID: ctx.Package.Owner.ID,
Type: packages_model.TypeRubyGems,
HasFileWithName: filename,
+ IsInternal: util.OptionalBoolFalse,
})
return pvs, err
}