refactor: refactor foundation

This commit is contained in:
2026-08-14 09:43:19 +03:00
parent 2e32d226d3
commit da585b157a
54 changed files with 4822 additions and 535 deletions
@@ -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"),
});
}