refactor: refactor foundation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { apiClient } from "../../../shared/api";
|
||||
import type { paths } from "../../../shared/api/generated/schema";
|
||||
import { apiQueryClient } from "@/shared/api";
|
||||
import type { paths } from "@/shared/api/generated/schema";
|
||||
|
||||
export const brokerageAccountsQueryKey = ["brokerage-accounts"] as const;
|
||||
|
||||
@@ -13,15 +13,6 @@ export function useBrokerageAccounts(accessToken: string | null) {
|
||||
enabled: Boolean(accessToken),
|
||||
staleTime: 60_000,
|
||||
retry: false,
|
||||
queryFn: async () => {
|
||||
const { data, error } = await apiClient.GET(
|
||||
"/api/v1/brokerage-accounts",
|
||||
{
|
||||
headers: { Authorization: `Bearer ${accessToken}` },
|
||||
},
|
||||
);
|
||||
if (error) throw error;
|
||||
return data as BrokerageAccount[];
|
||||
},
|
||||
...apiQueryClient.queryOptions("get", "/api/v1/brokerage-accounts"),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user