- Create code-first route tree in src/app/routing/routeTree.tsx - Replace ProtectedRoute with beforeLoad auth guards - Add useSearchParamsCompat for URLSearchParams access - Update App.tsx, layouts, and all page/widget imports - Add frontend tooling: biome, prettier, env config - Update all tests for TanStack Router compatibility - Remove react-router-dom dependency, @tanstack/router-plugin - Consolidate biome config at root level
15 lines
382 B
TypeScript
15 lines
382 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import type { BondResponse } from '@/shared/api/responses'
|
|
import { getBond } from '../api/bondApi'
|
|
|
|
export function useBond(secid: string) {
|
|
return useQuery<BondResponse>({
|
|
queryKey: ['bond', secid],
|
|
queryFn: async () => {
|
|
const res = await getBond(secid)
|
|
return res.data
|
|
},
|
|
staleTime: 900_000,
|
|
})
|
|
}
|