mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 12:55:06 +03:00
* Remove the query for temp keys. Remove the query for supabase client. Add a function which creates a supabase client with a temp key. * Add a new query for building the endpoint URL. * Migrate all oAuth queries and mutations to use the new function for creating a Supabase project client. * Use the new queries/mutations in the code. * Use query in refetchInterval for useProjectSettings. * Replace all uses in StorageExplorer with createProjectSupabaseClient.
18 lines
575 B
TypeScript
18 lines
575 B
TypeScript
import { IS_PLATFORM } from 'common'
|
|
import { ProjectSettingsVariables, useProjectSettingsV2Query } from './project-settings-v2-query'
|
|
|
|
export const useProjectEndpointQuery = ({ projectRef }: ProjectSettingsVariables) => {
|
|
return useProjectSettingsV2Query(
|
|
{ projectRef },
|
|
{
|
|
select: (data) => {
|
|
const protocol = data?.app_config?.protocol ?? 'https'
|
|
const endpoint = data?.app_config?.endpoint
|
|
const clientEndpoint = `${IS_PLATFORM ? 'https' : protocol}://${endpoint}`
|
|
|
|
return { endpoint: clientEndpoint }
|
|
},
|
|
}
|
|
)
|
|
}
|