chore: reword license backend error to only mention premium (#14799)

Phrasing for "enterprise" removed.
This commit is contained in:
Steven Masley
2024-09-25 13:41:21 -05:00
committed by GitHub
parent 575925c050
commit 6cd1219289

View File

@ -354,12 +354,9 @@ func (api *API) RequireFeatureMW(feat codersdk.FeatureName) func(http.Handler) h
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
// Entitlement must be enabled.
if !api.Entitlements.Enabled(feat) {
licenseType := "a Premium"
if feat.Enterprise() {
licenseType = "an Enterprise"
}
// All feature warnings should be "Premium", not "Enterprise".
httpapi.Write(r.Context(), rw, http.StatusForbidden, codersdk.Response{
Message: fmt.Sprintf("%s is %s feature. Contact sales!", feat.Humanize(), licenseType),
Message: fmt.Sprintf("%s is a Premium feature. Contact sales!", feat.Humanize()),
})
return
}