Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: remove nano_enabled flag usage (#34286)

Kevin Grüneberg5b7ffb586ad5
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx
index 4d547f3857e..9595f133aac 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx
@@ -72,7 +72,6 @@ const DowngradeModal = ({
}) || []
const hasInstancesOnMicro = projects.some((project) => project.infra_compute_size === 'micro')
- const downgradingToNano = subscription?.nano_enabled === true
return (
<Modal
@@ -93,8 +92,7 @@ const DowngradeModal = ({
unresponsive or enter read only mode."
/>
- {((previousProjectAddons.length ?? 0) > 0 ||
- (hasInstancesOnMicro && downgradingToNano)) && (
+ {((previousProjectAddons.length ?? 0) > 0 || hasInstancesOnMicro) && (
<Admonition type="warning" title="Projects affected by the downgrade">
<ul className="space-y-1 max-h-[100px] overflow-y-auto">
{previousProjectAddons.map((project) => (
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx
index f62c0a34626..99307541b11 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx
@@ -15,13 +15,12 @@ import ProjectUpdateDisabledTooltip from '../ProjectUpdateDisabledTooltip'
export interface ExitSurveyModalProps {
visible: boolean
- subscription?: OrgSubscription
projects: ProjectInfo[]
onClose: (success?: boolean) => void
}
// [Joshen] For context - Exit survey is only when going to Free Plan from a paid plan
-const ExitSurveyModal = ({ visible, subscription, projects, onClose }: ExitSurveyModalProps) => {
+const ExitSurveyModal = ({ visible, projects, onClose }: ExitSurveyModalProps) => {
const { slug } = useParams()
const captchaRef = useRef<HCaptcha>(null)
@@ -42,15 +41,9 @@ const ExitSurveyModal = ({ visible, subscription, projects, onClose }: ExitSurve
useSendDowngradeFeedbackMutation()
const isSubmitting = isUpdating || isSubmittingFeedback
- const projectsWithComputeDowngrade = projects.filter((project) => {
- const computeSizesThatDoNotResultInComputeDowngrade = ['nano']
-
- if (subscription?.nano_enabled === false) {
- computeSizesThatDoNotResultInComputeDowngrade.push('micro')
- }
-
- return !computeSizesThatDoNotResultInComputeDowngrade.includes(project.infra_compute_size!)
- })
+ const projectsWithComputeDowngrade = projects.filter(
+ (project) => project.infra_compute_size !== 'nano'
+ )
const hasProjectsWithComputeDowngrade = projectsWithComputeDowngrade.length > 0
diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
index 60c27b52382..aa34d230c93 100644
--- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
+++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx
@@ -601,7 +601,6 @@ const PlanUpdateSidePanel = () => {
<ExitSurveyModal
visible={showExitSurvey}
- subscription={subscription}
projects={orgProjects}
onClose={(success?: boolean) => {
setShowExitSurvey(false)
diff --git a/apps/studio/pages/api/platform/organizations/[slug]/billing/subscription.ts b/apps/studio/pages/api/platform/organizations/[slug]/billing/subscription.ts
index 82d60ae83b0..dfc1d786321 100644
--- a/apps/studio/pages/api/platform/organizations/[slug]/billing/subscription.ts
+++ b/apps/studio/pages/api/platform/organizations/[slug]/billing/subscription.ts
@@ -38,7 +38,6 @@ const handleGet = async (req: NextApiRequest, res: NextApiResponse<ResponseData>
billing_partner: 'fly',
scheduled_plan_change: null,
customer_balance: 0,
- nano_enabled: false,
}
return res.status(200).json(response)
diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.ts
index 61261b68df0..660edc672bf 100644
--- a/packages/api-types/types/platform.d.ts
+++ b/packages/api-types/types/platform.d.ts
@@ -5042,7 +5042,6 @@ export interface components {
current_period_end: number
current_period_start: number
customer_balance: number
- nano_enabled: boolean
next_invoice_at: number
payment_method_type: string
plan: components['schemas']['BillingSubscriptionPlan']