File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
+ import { useFindPets } from "@/openapi/queries" ;
3
4
import { ReactQueryDevtools } from "@tanstack/react-query-devtools" ;
4
- import { useFindPets } from "../openapi/queries" ;
5
5
6
6
export default function Pets ( ) {
7
7
const { data } = useFindPets ( {
Original file line number Diff line number Diff line change @@ -6,14 +6,12 @@ import {
6
6
import Link from "next/link" ;
7
7
import { prefetchUseFindPets } from "../openapi/queries/prefetch" ;
8
8
import Pets from "./components/Pets" ;
9
- import { client } from "./providers" ;
10
9
11
10
export default async function Home ( ) {
12
11
const queryClient = new QueryClient ( ) ;
13
12
14
13
await prefetchUseFindPets ( queryClient , {
15
14
query : { tags : [ ] , limit : 10 } ,
16
- client : client ,
17
15
} ) ;
18
16
19
17
return (
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
- import { createClient } from "@hey-api/client-fetch" ;
4
3
import { QueryClient , QueryClientProvider } from "@tanstack/react-query" ;
4
+ import "../fetchClient" ;
5
+
5
6
// We can not useState or useRef in a server component, which is why we are
6
7
// extracting this part out into
7
8
@@ -32,10 +33,6 @@ function getQueryClient() {
32
33
return browserQueryClient ;
33
34
}
34
35
35
- export const client = createClient ( {
36
- baseUrl : "http://localhost:4010" ,
37
- } ) ;
38
-
39
36
export default function Providers ( { children } : { children : React . ReactNode } ) {
40
37
// NOTE: Avoid useState when initializing the query client if you don't
41
38
// have a suspense boundary between this and the code that may
Original file line number Diff line number Diff line change
1
+ import { client } from "@/openapi/requests/services.gen" ;
2
+
3
+ client . setConfig ( {
4
+ baseUrl : "http://localhost:4010" ,
5
+ } ) ;
You can’t perform that action at this time.
0 commit comments