push
This commit is contained in:
@@ -5,6 +5,7 @@ import superjson from 'superjson'
|
||||
import { createElement, type ReactNode } from 'react'
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage'
|
||||
import type { AppRouter } from '@innungsapp/admin'
|
||||
import { getApiBaseUrl } from './api-url'
|
||||
|
||||
export const trpc = createTRPCReact<AppRouter>()
|
||||
|
||||
@@ -17,14 +18,10 @@ export const queryClient = new QueryClient({
|
||||
},
|
||||
})
|
||||
|
||||
function getApiUrl() {
|
||||
return process.env.EXPO_PUBLIC_API_URL ?? 'http://localhost:3000'
|
||||
}
|
||||
|
||||
const trpcClient = trpc.createClient({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: `${getApiUrl()}/api/trpc`,
|
||||
url: `${getApiBaseUrl()}/api/trpc`,
|
||||
transformer: superjson,
|
||||
async headers() {
|
||||
// Include session cookie for auth
|
||||
|
||||
Reference in New Issue
Block a user