Skip to content

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

Add is platform check against edge functions RQ

Joshen Lim7ebbfe1eeaf8
diff --git a/studio/data/edge-functions/edge-function-query.ts b/studio/data/edge-functions/edge-function-query.ts
index b43321d8562..30f21e12ecc 100644
--- a/studio/data/edge-functions/edge-function-query.ts
+++ b/studio/data/edge-functions/edge-function-query.ts
@@ -1,6 +1,6 @@
import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
import { get } from 'lib/common/fetch'
-import { API_ADMIN_URL } from 'lib/constants'
+import { API_ADMIN_URL, IS_PLATFORM } from 'lib/constants'
import { useCallback } from 'react'
import { edgeFunctionsKeys } from './keys'
@@ -46,7 +46,8 @@ export const useEdgeFunctionQuery = <TData = EdgeFunctionData>(
edgeFunctionsKeys.detail(projectRef, slug),
({ signal }) => getEdgeFunction({ projectRef, slug }, signal),
{
- enabled: enabled && typeof projectRef !== 'undefined' && typeof slug !== 'undefined',
+ enabled:
+ IS_PLATFORM && enabled && typeof projectRef !== 'undefined' && typeof slug !== 'undefined',
...options,
}
)
diff --git a/studio/data/edge-functions/edge-functions-query.ts b/studio/data/edge-functions/edge-functions-query.ts
index 28bc3f8c649..f0826e7373a 100644
--- a/studio/data/edge-functions/edge-functions-query.ts
+++ b/studio/data/edge-functions/edge-functions-query.ts
@@ -1,6 +1,6 @@
import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
import { get } from 'lib/common/fetch'
-import { API_ADMIN_URL } from 'lib/constants'
+import { API_ADMIN_URL, IS_PLATFORM } from 'lib/constants'
import { useCallback } from 'react'
import { edgeFunctionsKeys } from './keys'
@@ -41,7 +41,7 @@ export const useEdgeFunctionsQuery = <TData = EdgeFunctionsData>(
useQuery<EdgeFunctionsData, EdgeFunctionsError, TData>(
edgeFunctionsKeys.list(projectRef),
({ signal }) => getEdgeFunctions({ projectRef }, signal),
- { enabled: enabled && typeof projectRef !== 'undefined', ...options }
+ { enabled: IS_PLATFORM && enabled && typeof projectRef !== 'undefined', ...options }
)
export const useEdgeFunctionsPrefetch = ({ projectRef }: EdgeFunctionsVariables) => {