(queryClient: QueryClient, workspaceId: string)
| 13 | * {@link prefetchInternalJson}. |
| 14 | */ |
| 15 | export async function prefetchTables(queryClient: QueryClient, workspaceId: string): Promise<void> { |
| 16 | await queryClient.prefetchQuery({ |
| 17 | queryKey: tableKeys.list(workspaceId, 'active'), |
| 18 | queryFn: async () => { |
| 19 | const response = await prefetchInternalJson<{ data: { tables: TableDefinition[] } }>( |
| 20 | `/api/table?workspaceId=${workspaceId}&scope=active` |
| 21 | ) |
| 22 | return response.data.tables |
| 23 | }, |
| 24 | staleTime: 30 * 1000, |
| 25 | }) |
| 26 | } |
no outgoing calls
no test coverage detected