Sergey Krylov 9932278b64 feat: complete Phase 3 API type unification, delete stale test file
- Delete shared/api/responses.ts, move type re-exports to index.ts
- Update all 55+ imports from shared/api/responses to shared/api
- Delete stale client.test.ts (tested deleted client.ts)
- Run biome checks and fix import ordering
- Update tasks.md and plan.md to reflect actual approach
2026-06-23 20:24:16 +03:00

17 lines
452 B
TypeScript

import { useQuery } from '@tanstack/react-query'
import type { SearchResultItem } from '@/shared/api'
import { searchSecurities } from '../api/searchApi'
export function useSearch(query: string) {
return useQuery<SearchResultItem[]>({
queryKey: ['securities', 'search', query],
queryFn: async () => {
const res = await searchSecurities(query)
return res.data
},
enabled: query.length >= 2,
staleTime: 60_000,
})
}