MCPcopy Index your code
hub / github.com/simstudioai/sim / prefetchTables

Function prefetchTables

apps/sim/app/workspace/[workspaceId]/tables/prefetch.ts:15–26  ·  view source on GitHub ↗
(queryClient: QueryClient, workspaceId: string)

Source from the content-addressed store, hash-verified

13 * {@link prefetchInternalJson}.
14 */
15export 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}

Callers 2

prefetch.test.tsFile · 0.90
TablesPageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected