mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
2 files changed
+4
-2
No files matched your search
@@ -78,7 +78,7 @@ const DocView: FC<any> = observer(({}) => {
|
||||
const swaggerUrl = data?.autoApiService?.restUrl
|
||||
const headers: any = { apikey: API_KEY }
|
||||
|
||||
if (API_KEY?.length > 40) headers['authorization'] = `Bearer ${API_KEY}`
|
||||
if (API_KEY?.length > 40) headers['Authorization'] = `Bearer ${API_KEY}`
|
||||
|
||||
const { data: jsonSchema, error: jsonSchemaError } = useSWR(
|
||||
() => swaggerUrl,
|
||||
|
||||
@@ -116,6 +116,7 @@ export default class MetaStore implements IMetaStore {
|
||||
|
||||
connectionString?: string
|
||||
baseUrl: string
|
||||
queryBaseUrl: string
|
||||
excludedSchemas = [
|
||||
'auth',
|
||||
'extensions',
|
||||
@@ -132,6 +133,7 @@ export default class MetaStore implements IMetaStore {
|
||||
const { projectRef, connectionString } = options
|
||||
this.rootStore = rootStore
|
||||
this.baseUrl = `/api/pg-meta/${projectRef}`
|
||||
this.queryBaseUrl = `${API_URL}/pg-meta/${projectRef}`
|
||||
|
||||
const headers: any = {}
|
||||
if (IS_PLATFORM && connectionString) {
|
||||
@@ -166,7 +168,7 @@ export default class MetaStore implements IMetaStore {
|
||||
try {
|
||||
const headers: any = { 'Content-Type': 'application/json' }
|
||||
if (this.connectionString) headers['x-connection-encrypted'] = this.connectionString
|
||||
const url = `${this.baseUrl}/query`
|
||||
const url = `${this.queryBaseUrl}/query`
|
||||
const response = await post(url, { query: value }, { headers })
|
||||
if (response.error) throw response.error
|
||||
|
||||
|
||||
Reference in new issue
Block a user