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

Function useFolders

apps/sim/hooks/queries/folders.ts:65–74  ·  view source on GitHub ↗
(workspaceId?: string, options?: { scope?: FolderQueryScope })

Source from the content-addressed store, hash-verified

63}
64
65export function useFolders(workspaceId?: string, options?: { scope?: FolderQueryScope }) {
66 const scope = options?.scope ?? 'active'
67 return useQuery({
68 queryKey: folderKeys.list(workspaceId, scope),
69 queryFn: ({ signal }) => fetchFolders(workspaceId as string, scope, signal),
70 enabled: Boolean(workspaceId),
71 placeholderData: keepPreviousData,
72 staleTime: 60 * 1000,
73 })
74}
75
76const selectFolderMap = (folders: WorkflowFolder[]): Record<string, WorkflowFolder> =>
77 Object.fromEntries(folders.map((folder) => [folder.id, folder]))

Callers 8

LogsFunction · 0.90
HomeFunction · 0.90
EmbeddedFolderFunction · 0.90
useAvailableResourcesFunction · 0.90
useResourceNameLookupFunction · 0.90
RecentlyDeletedFunction · 0.90
sidebar.tsxFile · 0.90
workflow-list.tsxFile · 0.90

Calls 1

fetchFoldersFunction · 0.85

Tested by

no test coverage detected