The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
perf: remove customer endpoint call to determine missing address (#39549)
Kevin Grüneberg2fbd0668f805
diff --git a/apps/studio/hooks/misc/useOrganizationRestrictions.ts b/apps/studio/hooks/misc/useOrganizationRestrictions.tsindex 1486275bf51..54bdd88a012 100644--- a/apps/studio/hooks/misc/useOrganizationRestrictions.ts+++ b/apps/studio/hooks/misc/useOrganizationRestrictions.ts@@ -4,8 +4,6 @@ import { RESTRICTION_MESSAGES } from 'components/interfaces/Organization/restricimport { useOverdueInvoicesQuery } from 'data/invoices/invoices-overdue-query'import { useOrganizationsQuery } from 'data/organizations/organizations-query'import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'-import { useBillingCustomerDataForm } from 'components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm'-import { useOrganizationCustomerProfileQuery } from 'data/organizations/organization-customer-profile-query'import { useIsFeatureEnabled } from './useIsFeatureEnabled'export type WarningBannerProps = {@@ -20,7 +18,6 @@ export function useOrganizationRestrictions() {const { data: overdueInvoices } = useOverdueInvoicesQuery()const { data: organizations } = useOrganizationsQuery()- const { data: billingCustomer } = useOrganizationCustomerProfileQuery({ slug: org?.slug })const warnings: WarningBannerProps[] = []@@ -36,13 +33,7 @@ export function useOrganizationRestrictions() {(invoice) => invoice.organization_id === org?.id)- if (- org &&- org.plan.id !== 'free' &&- billingCustomer &&- !billingCustomer.address?.line1 &&- !org.billing_partner- ) {+ if (org && org.organization_missing_address && !org.billing_partner) {warnings.push({type: 'danger',title: RESTRICTION_MESSAGES.MISSING_BILLING_INFO.title,diff --git a/apps/studio/tests/helpers.tsx b/apps/studio/tests/helpers.tsxindex 2cfef6e0b9a..64dfcfcc5fc 100644--- a/apps/studio/tests/helpers.tsx+++ b/apps/studio/tests/helpers.tsx@@ -63,6 +63,7 @@ export const createMockOrganization = (details: Partial<Organization>): Organizaopt_in_tags: [],restriction_status: null,restriction_data: null,+ organization_missing_address: false,}return Object.assign(base, details)diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.tsindex b2a53293795..fdfe2f25611 100644--- a/packages/api-types/types/platform.d.ts+++ b/packages/api-types/types/platform.d.ts@@ -5013,6 +5013,7 @@ export interface components {is_owner: booleanname: stringopt_in_tags: string[]+ organization_missing_address: booleanorganization_requires_mfa: booleanplan: {/** @enum {string} */@@ -7259,6 +7260,7 @@ export interface components {is_owner: booleanname: stringopt_in_tags: string[]+ organization_missing_address: booleanorganization_requires_mfa: booleanplan: {/** @enum {string} */@@ -8238,8 +8240,14 @@ export interface components {max_events_per_second: number | null/** @description Sets maximum number of joins per second rate limit */max_joins_per_second: number | null+ /** @description Sets maximum number of payload size in KB rate limit */+ max_payload_size_in_kb: number | null+ /** @description Sets maximum number of presence events per second rate limit */+ max_presence_events_per_second: number | null/** @description Whether to only allow private channels */private_only: boolean | null+ /** @description Whether to suspend realtime */+ suspend: boolean | null}RegionsInfo: {all: {@@ -9989,8 +9997,14 @@ export interface components {max_events_per_second?: number/** @description Sets maximum number of joins per second rate limit */max_joins_per_second?: number+ /** @description Sets maximum number of payload size in KB rate limit */+ max_payload_size_in_kb?: number+ /** @description Sets maximum number of presence events per second rate limit */+ max_presence_events_per_second?: number/** @description Whether to only allow private channels */private_only?: boolean+ /** @description Whether to suspend realtime */+ suspend?: boolean}UpdateReplicationDestinationBody: {/** @description Destination configuration */