14 lines
426 B
TypeScript
14 lines
426 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import type { BrokerAccount } from '../../../api/responses';
|
|
import { getBrokerAccounts } from '../api/brokerAccountApi';
|
|
|
|
export function useBrokerAccounts() {
|
|
return useQuery<BrokerAccount[]>({
|
|
queryKey: ['broker', 'accounts'],
|
|
queryFn: async () => (await getBrokerAccounts()).data,
|
|
staleTime: 3_600_000,
|
|
retry: 2,
|
|
refetchOnWindowFocus: false,
|
|
});
|
|
}
|