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:
parent
b2b329e692
commit
845418e5aa
2 changed files with 3 additions and 3 deletions
|
@ -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 ? (
|
||||||
|
|
|
@ -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(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue