Skip to content

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

Bring changes from master and resolve conflicts

Joshen Lim1109f8bdb7e8
diff --cc studio/data/fetchers.ts
index d5b71130520,d5b71130520..61eff3ac84e
--- a/studio/data/fetchers.ts
+++ b/studio/data/fetchers.ts
@@@ -21,6 -21,6 +21,7 @@@ const
trace: _trace,
options: _options,
} = createClient<paths>({
++ // [Joshen] Just FYI, the replace is temporary until we update env vars API_URL to remove /platform or /v1 - should just be the base URL
baseUrl: API_URL?.replace('/platform', ''),
referrerPolicy: 'no-referrer-when-downgrade',
headers: DEFAULT_HEADERS,
diff --cc studio/data/integrations/integration-connections-create-mutation.ts
index 7b2e13c4c3d,b72f4bb064e..19bf3d3f989
--- a/studio/data/integrations/integration-connections-create-mutation.ts
+++ b/studio/data/integrations/integration-connections-create-mutation.ts
@@@ -1,9 -1,6 +1,8 @@@
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { toast } from 'react-hot-toast'
- import { post } from 'lib/common/fetch'
- import { API_URL } from 'lib/constants'
+ import { post } from 'data/fetchers'
+import { ResponseError } from 'types'
import { integrationKeys } from './keys'
export type IntegrationConnectionsCreateVariables = {
diff --cc studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx
index 3d9872ae146,80bd6c8d3ef..77755e83f76
--- a/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx
+++ b/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx
@@@ -92,15 -93,12 +93,11 @@@ const CreateProject = (
externalId,
} = useParams()
- const { mutate: createConnections, isLoading: isLoadingCreateConnections } =
- useIntegrationConnectionsCreateMutation({
- onSuccess: () => {
- setLoading(false)
- if (next) window.location.href = next
- },
- })
+ const { mutateAsync: createConnections, isLoading: isLoadingCreateConnections } =
+ useIntegrationConnectionsCreateMutation()
+ const { mutateAsync: syncEnvs } = useIntegrationsVercelConnectionSyncEnvsMutation()
const { data: organizationData, isLoading: isLoadingOrganizationsQuery } = useOrganizationsQuery()
-
const organization = organizationData?.find((x) => x.slug === slug)
/**
@@@ -231,18 -256,20 +228,20 @@@
}
isInstallingRef.current = true
-- const projectDetails = vercelProjects?.find((x) => x.id === foreignProjectId)
-
- createConnections({
- organizationIntegrationId: organizationIntegration?.id,
- connection: {
- foreign_project_id: foreignProjectId,
- supabase_project_ref: newProjectRef,
- metadata: {
- ...projectDetails,
- supabaseConfig: {
- projectEnvVars: {
- write: true,
++ const projectDetails = vercelProjects?.find((x: any) => x.id === foreignProjectId)
+
+ try {
+ const { id: connectionId } = await createConnections({
+ organizationIntegrationId: organizationIntegration?.id,
+ connection: {
+ foreign_project_id: foreignProjectId,
+ supabase_project_ref: newProjectRef,
+ metadata: {
+ ...projectDetails,
+ supabaseConfig: {
+ projectEnvVars: {
+ write: true,
+ },
},
},
},