1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

fix: Use baseUrl from env in AxiosProvider

This commit is contained in:
Six 2024-01-17 17:31:15 -08:00
parent b2b329e692
commit 845418e5aa
No known key found for this signature in database
GPG key ID: 00148D3869C21E43
2 changed files with 3 additions and 3 deletions

View file

@ -83,7 +83,7 @@ export default function App({
<Analytics /> <Analytics />
<QueryProvider> <QueryProvider>
<SessionProvider> <SessionProvider>
<AxiosProvider> <AxiosProvider baseUrl={env.NEXT_PUBLIC_API_URL}>
<> <>
<APM /> <APM />
{Page.isPublic === true ? ( {Page.isPublic === true ? (

View file

@ -67,8 +67,8 @@ function createInstance(options?: CreateInstanceOptions) {
return instance return instance
} }
export function AxiosProvider({ children }: PropsWithChildren) { export function AxiosProvider({ children, baseUrl }: PropsWithChildren<{baseUrl: string?}>) {
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3333' const API_URL = baseUrl || 'http://localhost:3333'
// Expose a default instance with auth, superjson, headers // Expose a default instance with auth, superjson, headers
const defaultInstance = useMemo(() => { const defaultInstance = useMemo(() => {