Skip to content

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

fix: org creation (#18957)

Kevin Grüneberg6e1620a20adc
diff --git a/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx b/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx
index 4cf76281f04..e87be9715fe 100644
--- a/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx
+++ b/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx
@@ -112,7 +112,6 @@ const NewOrgForm = ({ onPaymentMethodReset }: NewOrgFormProps) => {
tier: 'tier_' + dbTier.toLowerCase(),
...(orgKind == 'COMPANY' ? { size: orgSize } : {}),
payment_method: paymentMethodId,
- V2: true,
})
} catch (error) {
setNewOrgLoading(false)
diff --git a/studio/data/organizations/organization-create-mutation.ts b/studio/data/organizations/organization-create-mutation.ts
index 3e58e5ce921..bbb236e7596 100644
--- a/studio/data/organizations/organization-create-mutation.ts
+++ b/studio/data/organizations/organization-create-mutation.ts
@@ -12,16 +12,24 @@ export type OrganizationCreateVariables = {
size?: string
tier?: string
payment_method?: string
- V2?: boolean
}
-export async function createOrganization({ name, V2 = false }: OrganizationCreateVariables) {
+export async function createOrganization({
+ name,
+ kind,
+ size,
+ tier,
+ payment_method,
+}: OrganizationCreateVariables) {
const { data, error } = await post('/platform/organizations', {
- // @ts-ignore [Joshen] Generated API spec is wrong?
body: {
name,
+ // @ts-ignore [Joshen] Generated API spec is wrong
+ kind,
+ size,
+ tier,
+ payment_method,
},
- ...(V2 ? { headers: { Version: '2' } } : {}),
})
if (error) throw error
diff --git a/studio/pages/vercel/setupOrg.tsx b/studio/pages/vercel/setupOrg.tsx
index e2911b40e59..9a281fbda14 100644
--- a/studio/pages/vercel/setupOrg.tsx
+++ b/studio/pages/vercel/setupOrg.tsx
@@ -111,7 +111,7 @@ const CreateOrganization = observer(({}) => {
<Button
disabled={isCreating || orgName === ''}
loading={isCreating}
- onClick={() => createOrganization({ name: orgName })}
+ onClick={() => createOrganization({ name: orgName, tier: 'tier_free' })}
>
Create organization
</Button>