- 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
19 lines
654 B
TypeScript
19 lines
654 B
TypeScript
import { keepPreviousData, useQuery } from '@tanstack/react-query'
|
|
import type { BrokerOperationsPage } from '@/shared/api'
|
|
import { type BrokerOperationQuery, getBrokerOperations } from '../api/brokerOperationApi'
|
|
|
|
export function useBrokerOperations(
|
|
accountId: string | undefined,
|
|
query: BrokerOperationQuery = {},
|
|
) {
|
|
return useQuery<BrokerOperationsPage>({
|
|
queryKey: ['broker', 'operations', accountId, query],
|
|
enabled: Boolean(accountId),
|
|
queryFn: async () => (await getBrokerOperations(accountId!, query)).data,
|
|
staleTime: 300_000,
|
|
retry: 2,
|
|
placeholderData: keepPreviousData,
|
|
refetchOnWindowFocus: false,
|
|
})
|
|
}
|