feat: migrate task jobs to workflow notifications + timeline
This commit is contained in:
@@ -16,5 +16,6 @@ export const queryKeys = {
|
||||
portfolioSummary: () => ['portfolio', 'summary'] as const,
|
||||
latestPortfolioInsight: () => ['portfolio', 'insights', 'latest'] as const,
|
||||
task: (taskId: string) => ['tasks', 'detail', taskId] as const,
|
||||
taskTimeline: (taskId: string) => ['tasks', 'timeline', taskId] as const,
|
||||
recentTasks: (limit: number) => ['tasks', 'recent', limit] as const
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
getLatestPortfolioInsight,
|
||||
getPortfolioSummary,
|
||||
getTask,
|
||||
getTaskTimeline,
|
||||
listFilings,
|
||||
listHoldings,
|
||||
listRecentTasks,
|
||||
@@ -126,10 +127,18 @@ export function taskQueryOptions(taskId: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export function recentTasksQueryOptions(limit = 20) {
|
||||
export function taskTimelineQueryOptions(taskId: string) {
|
||||
return queryOptions({
|
||||
queryKey: queryKeys.recentTasks(limit),
|
||||
queryFn: () => listRecentTasks(limit),
|
||||
queryKey: queryKeys.taskTimeline(taskId),
|
||||
queryFn: () => getTaskTimeline(taskId),
|
||||
staleTime: 5_000
|
||||
});
|
||||
}
|
||||
|
||||
export function recentTasksQueryOptions(limit = 20) {
|
||||
return queryOptions({
|
||||
queryKey: queryKeys.recentTasks(limit),
|
||||
queryFn: () => listRecentTasks({ limit }),
|
||||
staleTime: 5_000
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user