Skip to content

Commit 57189a3

Browse files
committed
chore: use api client on quotes page
1 parent 5688211 commit 57189a3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VITE_API_BASE_URL=/mocks
1+
VITE_API_BASE_URL=
22
VITE_API_MOCKING_ENABLED=true

src/pages/quotes/QuotesPage.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { H3 } from "@/components/Headings"
33
import { PageTitle } from "@/components/PageTitle"
44
import { Button } from "@/components/ui/button"
55
import { Skeleton } from "@/components/ui/skeleton"
6+
import useApiClient from "@/hooks/use-api-client"
67
import useLocalStorage from "@/hooks/use-local-storage"
78
import { fetchAdminQuotePending } from "@/lib/api"
89
import { useSuspenseQuery } from "@tanstack/react-query"
@@ -33,15 +34,17 @@ function QuoteListPendingRaw() {
3334
}
3435

3536
function QuoteListPending() {
37+
const client = useApiClient();
38+
3639
const { data } = useSuspenseQuery({
3740
queryKey: ["quotes-pending"],
38-
queryFn: fetchAdminQuotePending,
41+
queryFn: () => client.listPendingQuotes(),
3942
})
4043

4144
return (
4245
<>
4346
<div className="flex flex-col gap-1">
44-
{data.quotes.map((it, index) => {
47+
{data.data ? data.data.quotes.map((it, index) => {
4548
return (
4649
<div key={index} className="flex gap-1 items-center text-sm">
4750
<span>{it}</span>
@@ -50,7 +53,7 @@ function QuoteListPending() {
5053
</Button>
5154
</div>
5255
)
53-
})}
56+
}) : (<></>)}
5457
</div>
5558
</>
5659
)

0 commit comments

Comments
 (0)