MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / getMeta

Function getMeta

client/src/api/metadata/queries.ts:65–82  ·  view source on GitHub ↗
(type: string, account: string, container: string, filePath: string, enabled = true)

Source from the content-addressed store, hash-verified

63};
64
65export const getMeta = (type: string, account: string, container: string, filePath: string, enabled = true) => {
66 const { dataSourcesQuery, filesQuery } = useUserSettings();
67 if (!dataSourcesQuery.data || !filesQuery.data) {
68 return useQuery(['invalidQuery'], () => null);
69 }
70 const { instance } = useMsal();
71 const metadataClient = MetadataClientFactory(type, filesQuery.data, dataSourcesQuery.data, instance);
72 return useQuery(
73 ['datasource', type, account, container, filePath, 'meta'],
74 () => {
75 return fetchMeta(metadataClient, type, account, container, filePath);
76 },
77 {
78 enabled: enabled && !!dataSourcesQuery.data && !!filesQuery.data,
79 staleTime: Infinity,
80 }
81 );
82};
83
84export const useUpdateMeta = (meta: SigMFMetadata) => {
85 let client = useQueryClient();

Callers 1

FileRowFunction · 0.90

Calls 3

useUserSettingsFunction · 0.90
MetadataClientFactoryFunction · 0.90
fetchMetaFunction · 0.85

Tested by

no test coverage detected