File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
- VITE_API_BASE_URL = /mocks
1
+ VITE_API_BASE_URL =
2
2
VITE_API_MOCKING_ENABLED = true
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { H3 } from "@/components/Headings"
3
3
import { PageTitle } from "@/components/PageTitle"
4
4
import { Button } from "@/components/ui/button"
5
5
import { Skeleton } from "@/components/ui/skeleton"
6
+ import useApiClient from "@/hooks/use-api-client"
6
7
import useLocalStorage from "@/hooks/use-local-storage"
7
8
import { fetchAdminQuotePending } from "@/lib/api"
8
9
import { useSuspenseQuery } from "@tanstack/react-query"
@@ -33,15 +34,17 @@ function QuoteListPendingRaw() {
33
34
}
34
35
35
36
function QuoteListPending ( ) {
37
+ const client = useApiClient ( ) ;
38
+
36
39
const { data } = useSuspenseQuery ( {
37
40
queryKey : [ "quotes-pending" ] ,
38
- queryFn : fetchAdminQuotePending ,
41
+ queryFn : ( ) => client . listPendingQuotes ( ) ,
39
42
} )
40
43
41
44
return (
42
45
< >
43
46
< div className = "flex flex-col gap-1" >
44
- { data . quotes . map ( ( it , index ) => {
47
+ { data . data ? data . data . quotes . map ( ( it , index ) => {
45
48
return (
46
49
< div key = { index } className = "flex gap-1 items-center text-sm" >
47
50
< span > { it } </ span >
@@ -50,7 +53,7 @@ function QuoteListPending() {
50
53
</ Button >
51
54
</ div >
52
55
)
53
- } ) }
56
+ } ) : ( < > </ > ) }
54
57
</ div >
55
58
</ >
56
59
)
You can’t perform that action at this time.
0 commit comments