diff --git a/src/Admin/AdminConsole/Controllers/OrganizationsController.cs b/src/Admin/AdminConsole/Controllers/OrganizationsController.cs index d9da7291fd..7190275f03 100644 --- a/src/Admin/AdminConsole/Controllers/OrganizationsController.cs +++ b/src/Admin/AdminConsole/Controllers/OrganizationsController.cs @@ -259,19 +259,23 @@ public class OrganizationsController : Controller { var freePlan = await _pricingClient.GetPlanOrThrow(model.PlanType.Value); var isDowngradingToFree = organization.PlanType != PlanType.Free && model.PlanType.Value == PlanType.Free; - switch (isDowngradingToFree) + if (isDowngradingToFree) { - case true when model.Seats.HasValue && model.Seats.Value > freePlan.PasswordManager.MaxSeats: + if (model.Seats.HasValue && model.Seats.Value > freePlan.PasswordManager.MaxSeats) + { TempData["Error"] = $"Organizations with more than {freePlan.PasswordManager.MaxSeats} seats cannot be downgraded to the Free plan"; return RedirectToAction("Edit", new { id }); - case true when model.MaxCollections > freePlan.PasswordManager.MaxCollections: + } + + if (model.MaxCollections > freePlan.PasswordManager.MaxCollections) + { TempData["Error"] = $"Organizations with more than {freePlan.PasswordManager.MaxCollections} collections cannot be downgraded to the Free plan. Your organization currently has {organization.MaxCollections} collections."; return RedirectToAction("Edit", new { id }); - case true: - model.MaxStorageGb = null; - model.ExpirationDate = null; - model.Enabled = true; - break; + } + + model.MaxStorageGb = null; + model.ExpirationDate = null; + model.Enabled = true; } }