1
0
Fork 0
forked from forgejo/forgejo

Hide internal package versions (#20492)

* Hide internal versions from most searches.

* Added test.
This commit is contained in:
KN4CK3R 2022-07-27 03:59:10 +02:00 committed by GitHub
parent 5ed082b624
commit a3d55ac523
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 66 additions and 31 deletions

View file

@ -122,8 +122,9 @@ func getVersionByNameAndVersion(ctx context.Context, ownerID int64, packageType
// GetVersionsByPackageType gets all versions of a specific type
func GetVersionsByPackageType(ctx context.Context, ownerID int64, packageType Type) ([]*PackageVersion, error) {
pvs, _, err := SearchVersions(ctx, &PackageSearchOptions{
OwnerID: ownerID,
Type: packageType,
OwnerID: ownerID,
Type: packageType,
IsInternal: util.OptionalBoolFalse,
})
return pvs, err
}
@ -137,6 +138,7 @@ func GetVersionsByPackageName(ctx context.Context, ownerID int64, packageType Ty
ExactMatch: true,
Value: name,
},
IsInternal: util.OptionalBoolFalse,
})
return pvs, err
}