feat: align investment client with hourly sync
This commit is contained in:
@@ -4,17 +4,25 @@ const brokerageAccountsQueryOptions = () =>
|
||||
apiQueryClient.queryOptions("get", "/api/v1/brokerage-accounts");
|
||||
|
||||
const brokerageAccountsQueryKey = brokerageAccountsQueryOptions().queryKey;
|
||||
const BROKERAGE_ACCOUNTS_STALE_TIME_MS = 1_800_000;
|
||||
|
||||
type BrokerageAccount = NonNullable<
|
||||
paths["/api/v1/brokerage-accounts"]["get"]["responses"][200]["content"]["application/json"]["data"]
|
||||
>[number];
|
||||
|
||||
type BrokerageAccountsResponse = paths["/api/v1/brokerage-accounts"]["get"]["responses"][200]["content"]["application/json"];
|
||||
|
||||
function useBrokerageAccounts() {
|
||||
return useResourceQuery({
|
||||
const query = useResourceQuery({
|
||||
meta: { accessGroup: "brokerage" },
|
||||
...brokerageAccountsQueryOptions(),
|
||||
staleTime: 60_000,
|
||||
staleTime: BROKERAGE_ACCOUNTS_STALE_TIME_MS,
|
||||
});
|
||||
|
||||
return {
|
||||
...query,
|
||||
sync: query.sync as BrokerageAccountsResponse["sync"] | null,
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user