⬆️ Bump @hey-api/openapi-ts from 0.73.0 to 0.97.3 and migrate to new client (#2388)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Yurii Motov
2026-08-07 18:25:28 +02:00
committed by GitHub
parent f8b7926d1c
commit a8f1ba0e70
42 changed files with 2820 additions and 1736 deletions
+10 -6
View File
@@ -5,21 +5,25 @@ import {
QueryClientProvider,
} from "@tanstack/react-query"
import { createRouter, RouterProvider } from "@tanstack/react-router"
import { AxiosError } from "axios"
import { StrictMode } from "react"
import ReactDOM from "react-dom/client"
import { ApiError, OpenAPI } from "./client"
import { client } from "./client/client.gen"
import { ThemeProvider } from "./components/theme-provider"
import { Toaster } from "./components/ui/sonner"
import "./index.css"
import { routeTree } from "./routeTree.gen"
OpenAPI.BASE = import.meta.env.VITE_API_URL ?? ""
OpenAPI.TOKEN = async () => {
return localStorage.getItem("access_token") || ""
}
client.setConfig({
baseURL: import.meta.env.VITE_API_URL ?? "",
auth: () => localStorage.getItem("access_token") || "",
})
const handleApiError = (error: Error) => {
if (error instanceof ApiError && [401, 403].includes(error.status)) {
if (
error instanceof AxiosError &&
[401, 403].includes(error.response?.status ?? 0)
) {
localStorage.removeItem("access_token")
window.location.href = "/login"
}