diff options
Diffstat (limited to 'app/graphql/types/package_type_enum.rb')
-rw-r--r-- | app/graphql/types/package_type_enum.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/graphql/types/package_type_enum.rb b/app/graphql/types/package_type_enum.rb index bc03b8f5f8b..6f50c166da3 100644 --- a/app/graphql/types/package_type_enum.rb +++ b/app/graphql/types/package_type_enum.rb @@ -2,8 +2,14 @@ module Types class PackageTypeEnum < BaseEnum + PACKAGE_TYPE_NAMES = { + pypi: 'PyPI', + npm: 'NPM' + }.freeze + ::Packages::Package.package_types.keys.each do |package_type| - value package_type.to_s.upcase, "Packages from the #{package_type} package manager", value: package_type.to_s + type_name = PACKAGE_TYPE_NAMES.fetch(package_type.to_sym, package_type.capitalize) + value package_type.to_s.upcase, "Packages from the #{type_name} package manager", value: package_type.to_s end end end |