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

Function useWorkspaceFileRecord

apps/sim/hooks/queries/workspace-files.ts:74–82  ·  view source on GitHub ↗
(workspaceId: string, fileId: string)

Source from the content-addressed store, hash-verified

72 * for the workspace and selects the matching record via `select`.
73 */
74export function useWorkspaceFileRecord(workspaceId: string, fileId: string) {
75 return useQuery({
76 queryKey: workspaceFilesKeys.list(workspaceId, 'active'),
77 queryFn: ({ signal }) => fetchWorkspaceFiles(workspaceId, 'active', signal),
78 enabled: !!workspaceId && !!fileId,
79 staleTime: 30 * 1000,
80 select: (files) => files.find((f) => f.id === fileId) ?? null,
81 })
82}
83
84/**
85 * Fetch workspace files from API

Callers 1

FileViewerFunction · 0.90

Calls 1

fetchWorkspaceFilesFunction · 0.85

Tested by

no test coverage detected