The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: project.subscription_tier to store tier product supabase_prod_id
phamhieu01a4b6517a5c
diff --git a/studio/pages/support/new.tsx b/studio/pages/support/new.tsxindex 2f2003e7df1..05998da7d60 100644--- a/studio/pages/support/new.tsx+++ b/studio/pages/support/new.tsx@@ -15,7 +15,7 @@ import SVG from 'react-inlinesvg'import Link from 'next/link'import { useRouter } from 'next/router'-import { API_URL } from 'lib/constants'+import { API_URL, PRICING_TIER_PRODUCT_IDS } from 'lib/constants'import { useStore, withAuth } from 'hooks'import { post, get } from 'lib/common/fetch'import { Project } from 'types'@@ -163,7 +163,7 @@ const SupportNew = () => {if (x.name === 'project') {const selectedProject = projects.find((project: any) => project.ref === x.value)if (- (selectedProject?.subscription_tier ?? 'FREE') === 'FREE' &&+ (selectedProject?.subscription_tier ?? PRICING_TIER_PRODUCT_IDS.FREE) === PRICING_TIER_PRODUCT_IDS.FREE &&formState.severity.value === 'Critical') {formDispatch({@@ -358,7 +358,7 @@ const SupportNew = () => {(project: any) => project.ref === formState.project.value)const isAllowedCritical =- (selectedProject?.subscription_tier ?? 'FREE') !== 'FREE'+ (selectedProject?.subscription_tier ?? PRICING_TIER_PRODUCT_IDS.FREE) !== PRICING_TIER_PRODUCT_IDS.FREEreturn (<Listbox.Optionkey={`option-${option.value}`}diff --git a/studio/stores/app/ProjectStore.ts b/studio/stores/app/ProjectStore.tsindex 2c96cd1e848..4d311638f9a 100644--- a/studio/stores/app/ProjectStore.ts+++ b/studio/stores/app/ProjectStore.ts@@ -54,12 +54,12 @@ export default class ProjectStore extends PostgresMetaInterface<Project> {if (!response.error) {const subscriptionInfo = response as {tier: {- key: string+ supabase_prod_id: string}}// update subscription_tier keyconst clone = cloneDeep(this.data[projectId])- clone.subscription_tier = subscriptionInfo.tier.key+ clone.subscription_tier = subscriptionInfo.tier.supabase_prod_idthis.data[projectId] = clone}}diff --git a/studio/types/base.ts b/studio/types/base.tsindex 47384047b33..687ad48faa9 100644--- a/studio/types/base.ts+++ b/studio/types/base.ts@@ -30,7 +30,7 @@ export interface Project extends ProjectBase {kpsVersion?: stringinternalApiKey?: stringrestUrl?: string- // FREE, PRO or PAYG+ // the same as stripe.products.metadata.supabase_prod_idsubscription_tier?: string/**