♻️ Migrate frontend client generation from openapi-typescript-codegen
to @hey-api/openapi-ts
(#1151)
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
import { createFileRoute } from "@tanstack/react-router"
|
||||
import { useQuery, useQueryClient } from "react-query"
|
||||
|
||||
import { type ApiError, type UserOut, UsersService } from "../../client"
|
||||
import { type UserOut, UsersService } from "../../client"
|
||||
import ActionsMenu from "../../components/Common/ActionsMenu"
|
||||
import Navbar from "../../components/Common/Navbar"
|
||||
import useCustomToast from "../../hooks/useCustomToast"
|
||||
@@ -37,7 +37,7 @@ function Admin() {
|
||||
} = useQuery("users", () => UsersService.readUsers({}))
|
||||
|
||||
if (isError) {
|
||||
const errDetail = (error as ApiError).body?.detail
|
||||
const errDetail = (error as any).body?.detail
|
||||
showToast("Something went wrong.", `${errDetail}`, "error")
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import {
|
||||
import { createFileRoute } from "@tanstack/react-router"
|
||||
import { useQuery } from "react-query"
|
||||
|
||||
import { type ApiError, ItemsService } from "../../client"
|
||||
import { ItemsService } from "../../client"
|
||||
import ActionsMenu from "../../components/Common/ActionsMenu"
|
||||
import Navbar from "../../components/Common/Navbar"
|
||||
import useCustomToast from "../../hooks/useCustomToast"
|
||||
@@ -33,7 +33,7 @@ function Items() {
|
||||
} = useQuery("items", () => ItemsService.readItems({}))
|
||||
|
||||
if (isError) {
|
||||
const errDetail = (error as ApiError).body?.detail
|
||||
const errDetail = (error as any).body?.detail
|
||||
showToast("Something went wrong.", `${errDetail}`, "error")
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ import {
|
||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||
|
||||
import Logo from "../assets/images/fastapi-logo.svg"
|
||||
import type { Body_login_login_access_token as AccessToken } from "../client/models/Body_login_login_access_token"
|
||||
import type { Body_login_login_access_token as AccessToken } from "../client"
|
||||
import useAuth, { isLoggedIn } from "../hooks/useAuth"
|
||||
import { emailPattern } from "../utils"
|
||||
|
||||
|
@@ -64,7 +64,7 @@ function ResetPassword() {
|
||||
navigate({ to: "/login" })
|
||||
},
|
||||
onError: (err: ApiError) => {
|
||||
const errDetail = err.body?.detail
|
||||
const errDetail = (err.body as any)?.detail
|
||||
showToast("Something went wrong.", `${errDetail}`, "error")
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user