feat(events): add date filters to upcoming events
This commit is contained in:
@@ -9,12 +9,15 @@ type EventsEndpoint =
|
||||
type BrokerageEvent =
|
||||
EventsEndpoint["responses"][200]["content"]["application/json"]["events"][number];
|
||||
|
||||
function useBrokerageEvents(accountId: string | undefined) {
|
||||
function useBrokerageEvents(
|
||||
accountId: string | undefined,
|
||||
query: EventsEndpoint["parameters"]["query"] = {},
|
||||
) {
|
||||
return useAuthenticatedQuery({
|
||||
...apiQueryClient.queryOptions(
|
||||
"get",
|
||||
"/api/v1/brokerage-accounts/{accountId}/events",
|
||||
{ params: { path: { accountId: accountId ?? "" } } },
|
||||
{ params: { path: { accountId: accountId ?? "" }, query } },
|
||||
),
|
||||
enabled: Boolean(accountId),
|
||||
staleTime: 30_000,
|
||||
|
||||
Reference in New Issue
Block a user